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

resolve() is always strict with Python 2.7 on Windows #45

Closed
matthew16550 opened this issue Aug 7, 2018 · 1 comment
Closed

resolve() is always strict with Python 2.7 on Windows #45

matthew16550 opened this issue Aug 7, 2018 · 1 comment

Comments

@matthew16550
Copy link

I'm using pathlib2 version 2.3.2.

On Windows with Python 2.7 the strict=False option has no effect:

Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:25:58) [MSC v.1500 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pathlib2
>>> pathlib2.Path('foo').resolve(False)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python27\lib\site-packages\pathlib2\__init__.py", line 1343, in resolve
    self.stat()
  File "c:\Python27\lib\site-packages\pathlib2\__init__.py", line 1356, in stat
    return self._accessor.stat(self)
  File "c:\Python27\lib\site-packages\pathlib2\__init__.py", line 541, in wrapped
    return strfunc(str(pathobj), *args)
WindowsError: [Error 2] The system cannot find the file specified: 'foo'

On OSX with Python 2.7 it works ok:

Python 2.7.15 (default, Jun 17 2018, 13:05:56)
[GCC 4.2.1 Compatible Apple LLVM 9.0.0 (clang-900.0.39.2)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pathlib2
>>> pathlib2.Path('/foo').resolve(False)
PosixPath('/foo')

And on Windows with Python 3.7 it works ok:

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:59:51) [MSC v.1914 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pathlib2
>>> pathlib2.Path('foo').resolve(False)
WindowsPath('foo')
@mcmtroffaes
Copy link
Collaborator

I think this is the same as issue #47 - let's discuss further there.

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

No branches or pull requests

2 participants