Closed Bug 1289949 Opened 3 years ago Closed 3 years ago

mozpack.path misbehaves on mingw python

Categories

(Firefox Build System :: General, defect)

defect
Not set

Tracking

(firefox50 fixed)

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: glandium, Unassigned)

References

Details

Attachments

(1 file)

In mozilla-build python:

>>> import mozpack.path as mozpath
>>> mozpath.dirname(r'c:\foo\bar')
'c:/foo'
>>> import os
>>> os.sep
'\\'
>>> os.altsep
'/'
>>>

In mingw python:
>>> import mozpack.path as mozpath
>>> mozpath.dirname(r'c:\foo\bar')
''
>>> import os
>>> os.sep
'/'
>>> os.altsep
'\\'
>>>
Mingw python has a different os.path setup from native python, and has
os.sep and os.altsep reversed. In that case, the normsep function was
doing the wrong thing, leading to all sorts of problems.

While fixing this, also ensure the corresponding unit test covers this
peculiarity, even when running under the native win32 python.

Review commit: https://reviewboard.mozilla.org/r/67690/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/67690/
Attachment #8775512 - Flags: review?(gps)
Comment on attachment 8775512 [details]
Bug 1289949 - Make mozpack.path properly handle paths on mingw python.

https://reviewboard.mozilla.org/r/67690/#review65102
Attachment #8775512 - Flags: review?(gps) → review+
Pushed by mh@glandium.org:
https://hg.mozilla.org/integration/autoland/rev/b9adb0648dba
Make mozpack.path properly handle paths on mingw python. r=gps
https://hg.mozilla.org/mozilla-central/rev/b9adb0648dba
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.