This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: pathlib.WindowsPath.resolve() test expects short path
Type: behavior Stage: needs patch
Components: Tests, Windows Versions: Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: paul.moore, steve.dower, tim.golden, zach.ware
Priority: normal Keywords: 3.6regression

Created on 2016-12-17 00:09 by steve.dower, last changed 2022-04-11 14:58 by admin.

Messages (1)
msg283452 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-12-17 00:09
With issue19717, WindowsPath.resolve() now properly resolves the filename using the Windows APIs.

However, this may cause parts of the path to be replaced with their full name when provided as the 8.3 short name. The test was not updated for this:

Traceback (most recent call last):
  File "C:\build\cpython36\lib\test\test_pathlib.py", line 1547, in test_resolve_common
    self._check_resolve_relative(p, P(d, 'foo'), False)
  File "C:\build\cpython36\lib\test\test_pathlib.py", line 1491, in _check_resolve
    self.assertEqual(q, expected)
AssertionError: WindowsPath('C:/Users/steve.dower/AppData/Local/Temp/2/tmptnm6y2cm-dirD/foo') != WindowsPath('C:/Users/STEVE~1.DOW/AppData/Local/Temp/2/tmptnm6y2cm-dirD/foo')

We should make sure the test is referring to the same file rather than doing a direct path comparison. Maybe write a UUID into a file and read it out?
History
Date User Action Args
2022-04-11 14:58:40adminsetgithub: 73181
2016-12-17 00:09:00steve.dowercreate