You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: This error might be a result of my lack of understanding of how Windows shell commands work.
When executing the script from the Windows shell as such: C:\path\of\pyqt4topyqt5file\> python pyqt4topyqt5.py fileToConvert.py
The error pyqt4topyqt5.py: error: unrecognized arguments: fileToConvert.py appears, and the conversion doesn't occur.
However, I noticed that when providing no arguments C:\path\of\pyqt4topyqt5file\> python pyqt4topyqt5.py
the pyqt4topyqt5.py file successfully converts itself, creating the pyqt4topyqt5_PyQt5.py and the log file in the process.
I wondered if the Windows shell might be providing the pyqt4topyqt5.py filename as the first system argument, and after some quick testing that seems to be the case.
This implies to me that the Windows shell starts the system arguments with the original file name, while the program operates with the first system argument being the first given argument (which would result in the self conversion behavior seen above).
I was able to fix this by simply adding an args.pop(0) to the beginning of the init method (line 2435), after which the script seems to work as intended, though I wanted to add this as an issue rather than a change request because I'm unsure if this is how other platforms/systems operate and if there is a proper way of executing this script on Windows.
Hope this helps anyone who was having trouble.
The text was updated successfully, but these errors were encountered:
Note: This error might be a result of my lack of understanding of how Windows shell commands work.
When executing the script from the Windows shell as such:
C:\path\of\pyqt4topyqt5file\> python pyqt4topyqt5.py fileToConvert.py
The error
pyqt4topyqt5.py: error: unrecognized arguments: fileToConvert.py
appears, and the conversion doesn't occur.However, I noticed that when providing no arguments
C:\path\of\pyqt4topyqt5file\> python pyqt4topyqt5.py
the pyqt4topyqt5.py file successfully converts itself, creating the pyqt4topyqt5_PyQt5.py and the log file in the process.
I wondered if the Windows shell might be providing the pyqt4topyqt5.py filename as the first system argument, and after some quick testing that seems to be the case.
This implies to me that the Windows shell starts the system arguments with the original file name, while the program operates with the first system argument being the first given argument (which would result in the self conversion behavior seen above).
I was able to fix this by simply adding an args.pop(0) to the beginning of the init method (line 2435), after which the script seems to work as intended, though I wanted to add this as an issue rather than a change request because I'm unsure if this is how other platforms/systems operate and if there is a proper way of executing this script on Windows.
Hope this helps anyone who was having trouble.
The text was updated successfully, but these errors were encountered: