jimbo1qaz_ via Gmail <jimbo1...@gmail.com> added the comment:

Should Path.resolve() also avoid raising OSError?

Path('*').resolve()

Traceback (most recent call last):
...truncated
  File "<ipython-input-5-4fa2fec5c8b3>", line 1, in <module>
    Path('*').resolve()
  File 
"C:\Users\jimbo1qaz\AppData\Local\Programs\Python\Python37\lib\pathlib.py", 
line 1134, in resolve
    s = self._flavour.resolve(self, strict=strict)
  File 
"C:\Users\jimbo1qaz\AppData\Local\Programs\Python\Python37\lib\pathlib.py", 
line 192, in resolve
    s = self._ext_to_normal(_getfinalpathname(s))
OSError: [WinError 123] The filename, directory name, or volume label syntax is 
incorrect: '*'


os.path.realpath('"*')
Out[8]: 'C:\\Users\\jimbo1qaz\\Dropbox\\encrypted\\code\\corrscope\\"*'
os.path.abspath('*"')
Out[13]: 'C:\\Users\\jimbo1qaz\\Dropbox\\encrypted\\code\\corrscope\\*"'

(sidenote: what os.path operation does Path.resolve() match? 
Path('nonexistent').resolve() returns a relative path on Python 3.7.1, whereas 
Path().resolve() returns an absolute path.)

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue35306>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to