-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Closed
Labels
platform: windowswindows platform-specific problemwindows platform-specific problemstatus: needs informationreporter needs to provide more information; can be closed after 2 or more weeks of inactivityreporter needs to provide more information; can be closed after 2 or more weeks of inactivitytype: bugproblem that needs to be addressedproblem that needs to be addressed
Description
py.path.local has a footgun flaw: __eq__ on Windows is case-insensitive, but __hash__ returns the hash of the strpath directly, meaning a == b does not imply hash(a) == hash(b). So things like this are possible:
import sys, py
assert sys.platform == "win32"
a = py.path.local("/some/path")
b = py.path.local("/some/PATH")
assert a == b # Passes
assert a in {b} # Fails
assert a in {b: 'b'} # FailsThis probably causes some subtle bugs in pytest, which uses several dicts & sets of py.path.locals. Since py is frozen, it's not possible to fix there.
I haven't checked it yet, but wanted to make a note for later.
Metadata
Metadata
Assignees
Labels
platform: windowswindows platform-specific problemwindows platform-specific problemstatus: needs informationreporter needs to provide more information; can be closed after 2 or more weeks of inactivityreporter needs to provide more information; can be closed after 2 or more weeks of inactivitytype: bugproblem that needs to be addressedproblem that needs to be addressed