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

pathlib.WindowsPath.resolve() test expects short path #73181

Closed
zooba opened this issue Dec 17, 2016 · 2 comments
Closed

pathlib.WindowsPath.resolve() test expects short path #73181

zooba opened this issue Dec 17, 2016 · 2 comments
Labels
3.7 (EOL) end of life OS-windows tests Tests in the Lib/test dir topic-pathlib type-bug An unexpected behavior, bug, or error

Comments

@zooba
Copy link
Member

zooba commented Dec 17, 2016

BPO 28995
Nosy @pfmoore, @tjguk, @zware, @zooba

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = None
created_at = <Date 2016-12-17.00:09:00.805>
labels = ['3.7', 'type-bug', 'tests', 'OS-windows']
title = 'pathlib.WindowsPath.resolve() test expects short path'
updated_at = <Date 2016-12-17.00:09:00.805>
user = 'https://github.com/zooba'

bugs.python.org fields:

activity = <Date 2016-12-17.00:09:00.805>
actor = 'steve.dower'
assignee = 'none'
closed = False
closed_date = None
closer = None
components = ['Tests', 'Windows']
creation = <Date 2016-12-17.00:09:00.805>
creator = 'steve.dower'
dependencies = []
files = []
hgrepos = []
issue_num = 28995
keywords = ['3.6regression']
message_count = 1.0
messages = ['283452']
nosy_count = 4.0
nosy_names = ['paul.moore', 'tim.golden', 'zach.ware', 'steve.dower']
pr_nums = []
priority = 'normal'
resolution = None
stage = 'needs patch'
status = 'open'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue28995'
versions = ['Python 3.6', 'Python 3.7']

@zooba
Copy link
Member Author

zooba commented Dec 17, 2016

With bpo-19717, 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?

@zooba zooba added 3.7 (EOL) end of life tests Tests in the Lib/test dir OS-windows type-bug An unexpected behavior, bug, or error labels Dec 17, 2016
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
@barneygale
Copy link
Contributor

This was fixed as part of GH-79158.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.7 (EOL) end of life OS-windows tests Tests in the Lib/test dir topic-pathlib type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants