Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix devpy erros for working on windows #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ados1991
Copy link

C:\Users...\Desktop\doker\oscaro\env\Scripts\python.exe C:/Users/.../.../config/test/test.py

TypeError: mkdir() got an unexpected keyword argument 'exist_ok' cause from this redefined function for WindowsPath :

mkdir(mode=511, parents=False) method of pathlib.WindowsPath instance

Traceback (most recent call last):
File "C:/Users/.../.../config/test/test.py", line 1, in
import devpy.develop as log
File "C:\Users...\Desktop\doker\oscaro\env\lib\site-packages\devpy\develop_init_.py", line 6, in
sys.modules['devpy.develop'] = dev_mode()
File "C:\Users...\Desktop\doker\oscaro\env\lib\site-packages\devpy_init_.py", line 14, in dev_mode
return devpy.autolog()
File "C:\Users...\Desktop\doker\oscaro\env\lib\site-packages\devpy\log.py", line 50, in autolog
log_file = path or Path(temp_dir(name)) / "auto.log"
File "C:\Users...\Desktop\doker\oscaro\env\lib\site-packages\devpy\temp.py", line 10, in temp_dir
directory.mkdir(exist_ok=True)
TypeError: mkdir() got an unexpected keyword argument 'exist_ok'

Process finished with exit code 1

TypeError: 'WindowsPath' does not support the buffer interface, pass str(WindowsPath instance) to RotatingFileHandler:
file_handler = RotatingFileHandler(str(log_file), 'a', 1000000, 1)

C:\Users...\Desktop\doker\oscaro\env\Scripts\python.exe C:/Users/.../.../config/test/test.py

Traceback (most recent call last):
File "C:/Users/.../.../config/test/test.py", line 1, in
import devpy.develop as log
File "C:\Users...\Desktop\doker\oscaro\env\lib\site-packages\devpy\develop_init_.py", line 6, in
sys.modules['devpy.develop'] = dev_mode()
File "C:\Users...\Desktop\doker\oscaro\env\lib\site-packages\devpy_init_.py", line 14, in dev_mode
return devpy.autolog()
File "C:\Users...\Desktop\doker\oscaro\env\lib\site-packages\devpy\log.py", line 55, in autolog
file_handler = RotatingFileHandler(log_file, 'a', 1000000, 1)
File "C:\Python34\Lib\logging\handlers.py", line 150, in init
BaseRotatingHandler.init(self, filename, mode, encoding, delay)
File "C:\Python34\Lib\logging\handlers.py", line 57, in init
logging.FileHandler.init(self, filename, mode, encoding, delay)
File "C:\Python34\Lib\logging_init_.py", line 996, in init
self.baseFilename = os.path.abspath(filename)
File "C:\Users...\Desktop\doker\oscaro\env\lib\ntpath.py", line 547, in abspath
path = _getfullpathname(path)
TypeError: 'WindowsPath' does not support the buffer interface

Process finished with exit code 1

@sametmax
Copy link
Owner

That is not a problem from windows. It's a 3.5 compat problem.

@ados1991
Copy link
Author

Maybe because me i'am working with python3.4, and also for windospath instance the method mkdir dont take the keyword parameter exist_ok this is why i add os.name = 'nt' in temp.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants