classification
Title: pathlib: "Incorrect function" during resolve()
Type: Stage:
Components: Windows Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: earonesty2, maciozo, paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords:

Created on 2017-10-22 21:31 by earonesty2, last changed 2019-11-07 16:30 by maciozo.

Messages (2)
msg304767 - (view) Author: Erik Aronesty (earonesty2) * Date: 2017-10-22 21:31
When strict is "false", pathlib should not fail if the network share is inaccessible.  It should, as documented, catch the exception and continue with as much of the path as it has.



>>> pathlib.Path("v:").resolve()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\erik\AppData\Local\Programs\Python\Python36\lib\pathlib.py", line 1119, in resolve
    s = self._flavour.resolve(self, strict=strict)
  File "C:\Users\erik\AppData\Local\Programs\Python\Python36\lib\pathlib.py", line 193, in resolve
    s = self._ext_to_normal(_getfinalpathname(s))
OSError: [WinError 1] Incorrect function: 'v:'
msg356199 - (view) Author: (maciozo) Date: 2019-11-07 16:30
Same error occurs when attempting to resolve a path on an ImDisk RAM disk:

>>> pathlib.Path("T:\\").resolve()
Traceback (most recent call last):
  File "<input>", line 1, in <module>
  File "C:\Users\maciozo\AppData\Local\Continuum\miniconda3\envs\brainboxes\lib\pathlib.py", line 1151, in resolve
    s = self._flavour.resolve(self, strict=strict)
  File "C:\Users\maciozo\AppData\Local\Continuum\miniconda3\envs\brainboxes\lib\pathlib.py", line 202, in resolve
    s = self._ext_to_normal(_getfinalpathname(s))
OSError: [WinError 1] Incorrect function: 'T:\\'
History
Date User Action Args
2019-11-07 16:30:50maciozosetnosy: + maciozo
messages: + msg356199
2017-10-22 21:31:34earonesty2setnosy: + paul.moore, tim.golden, steve.dower, zach.ware
components: + Windows
2017-10-22 21:31:13earonesty2create