`FileNotFoundError` when upgrading moz-phab on Windows
Categories
(Conduit :: moz-phab, defect, P2)
Tracking
(Not tracked)
People
(Reporter: mhentges, Assigned: mhentges)
References
Details
(Keywords: conduit-triaged)
Attachments
(1 file)
Sentry ticket.
This is affecting multiple people, as there are many server_names affected.
In Barret's description of the bug in Slack today: they ran a moz-phab command, tried to auto-update, then crashed. Fortunately, re-running their command the second time succeeds. I'm assuming that this means that though auto-update threw an exception, the actual version of moz-phab was properly updated.
Updated•5 years ago
|
Comment 1•5 years ago
|
||
I've apparently been stuck on 0.1.92 for ages because the self update doesn't actually completely run pip.
Here is a stack trace from moz-phab self-update --debug:
File "c:\python37\lib\site-packages\mozphab\mozphab.py", line 88, in main
args.func(args)
File "c:\python37\lib\site-packages\mozphab\commands\self_update.py", line 17, in self_update
self_upgrade()
File "c:\python37\lib\site-packages\mozphab\updater.py", line 148, in self_upgrade
exe.rename(temp_exe)
File "c:\python37\lib\pathlib.py", line 1319, in rename
self._accessor.rename(self, target)
FileNotFoundError: [WinError 3] The system cannot find the path specified: 'C:\\Python37\\Scripts\\moz-phab.exe\\moz-phab.exe' -> 'C:\\Python37\\Scripts\\moz-phab.exe\\moz-phab-temp.exe'
Comment 2•5 years ago
|
||
I did some debugging and script_module.__file__ resolves to C:\Python37\Scripts\moz-phab.exe\__main__.py which doesn't exist because C:\Python37\Scripts\moz-phab.exe is an executable, not a directory.
| Assignee | ||
Comment 3•5 years ago
|
||
I'm seeing more people CC to this, so I took a closer look with Barret's help.
Reproduce steps:
- Install MozillaBuild
pip3 install wheelpip3 install mozphabmoz-phab self-update.
Workaround
pip3 uninstall wheelpip3 install --no-cache mozphabmoz-phab self-update
| Assignee | ||
Comment 4•5 years ago
|
||
The issue is in the way that moz-phab tries to identify its entry point script.
It does so by resolving __main__, assumes that that's a file in Scripts (or bin), and operates in that directory accordingly.
Unfortunately, when using wheel, setuptools can cause __main__ to point to an invalid file (Scripts/moz-phab.exe/__main__.py). Things unravel from here.
| Assignee | ||
Comment 5•5 years ago
|
||
Work around setuptools bug where the "main" module's
path refers to the entry point as a directory, not a file.
| Assignee | ||
Updated•4 years ago
|
| Assignee | ||
Updated•4 years ago
|
Description
•