[New-bugs-announce] [issue28995] pathlib.WindowsPath.resolve() test expects short path

Steve Dower report at bugs.python.org
Fri Dec 16 19:09:00 EST 2016


New submission from Steve Dower:

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?

----------
components: Tests, Windows
keywords: 3.6regression
messages: 283452
nosy: paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
stage: needs patch
status: open
title: pathlib.WindowsPath.resolve() test expects short path
type: behavior
versions: Python 3.6, Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue28995>
_______________________________________


More information about the New-bugs-announce mailing list