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
py3k fails under Windows if "-c" or "-m" is given a non-ascii value #47955
Comments
The explanation is quite simple: in Py_Main, the arguments are converted Which gives: $ ./python -c "print('à')"
Fatal Python error: not enough memory to copy -c argument
Erreur de segmentation (core dumped)
$ ./python -m à
Fatal Python error: not enough memory to copy -m argument
Erreur de segmentation (core dumped) |
Here is a patch which works under Linux. Under Windows it doesn't choke Here is an example: $ ./python -c "print(ord('ሀ'))"
4608
$ cat > ሀ.py
print(__file__)
$ ./python -m ሀ
/home/antoine/py3k/mbstowcs/ሀ.py
$ ./python ሀ.py
ሀ.py |
Hmm. I suppose anything is better than segfaulting. I think the patch is |
Committed in r66269. |
This patch corrects the "-m" case on windows: the path has to be |
Looks good and works under Linux. |
Updated patch. |
./python -c "print('à')" I join another patch, which propagates the wchar_t as far as possible, This also corrects the Windows case. |
I think the patch good; go ahead. |
Applied both patches as r66331. |
Unfortunately, my patch does not work: see the compile warnings in "main.c": I reverted the change, and will try something else... |
Today I learned something: wchar_t can be 2 or 4 bytes, PyUNICODE can be Attached a new patch (command_unicode_2.patch) for review. |
Raising to release blocker, just to trigger another review... |
Go ahead. |
Fixed as r67190. Thanks for the review. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: