Issue3813
Created on 2008-09-09 08:39 by ocean-city, last changed 2022-04-11 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| py3k_getpath_v1.patch | ocean-city, 2008-09-09 08:39 | _Py_wreadlink won't terminate buf with NULL | ||
| py3k_getpath_v2.patch | ocean-city, 2008-09-09 08:42 | _Py_wreadlink will terminate buf with NULL (standard _readlink won't) | ||
| py3k_getpath_v3.patch | ocean-city, 2008-09-09 13:25 | probably final patch | ||
| Messages (5) | |||
|---|---|---|---|
| msg72831 - (view) | Author: Hirokazu Yamamoto (ocean-city) * ![]() |
Date: 2008-09-09 08:39 | |
On cygwin, py3k aborts if lanches it via symbolic link. //////////// message beg ///////////////////////// Could not find platform independent libraries <prefix> Could not find platform dependent libraries <exec_prefix> Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>] Fatal Python error: Py_Initialize: can't initialize sys standard streams ImportError: No module named encodings.utf_8 Aborted (core dumped) //////////// message end ///////////////////////// This is because mbstowcs() on cygwin is broken, so _Py_wreadlink() in Modules/getpath.c is also broken. I'll attach two patches to fix this. I don't know which is better. |
|||
| msg72852 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * ![]() |
Date: 2008-09-09 12:28 | |
http://man.he.net/man3/readlink says: "Conforming applications should not assume that the returned contents of the symbolic link are null-terminated" cygwin is not broken, but very (too much?) conforming in this case ;-) I think your second patch is the correct one, just keep the "return (int)r1;" because the return value is stored in a "linklen" variable. |
|||
| msg72854 - (view) | Author: Hirokazu Yamamoto (ocean-city) * ![]() |
Date: 2008-09-09 13:25 | |
Oh, I misunderstood the reason... readlink() can return non-null-terminated string, so mbstowcs may convert illegual memory area. I've attached py3k_getpath_v3.patch. |
|||
| msg72857 - (view) | Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * ![]() |
Date: 2008-09-09 13:39 | |
Your patch is OK for me. Please apply! |
|||
| msg72862 - (view) | Author: Hirokazu Yamamoto (ocean-city) * ![]() |
Date: 2008-09-09 13:59 | |
Thanks, fixed in r66338(py3k). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:56:38 | admin | set | github: 48063 |
| 2008-09-09 13:59:08 | ocean-city | set | status: open -> closed resolution: accepted -> fixed messages: + msg72862 |
| 2008-09-09 13:39:30 | amaury.forgeotdarc | set | keywords:
- needs review resolution: accepted messages: + msg72857 |
| 2008-09-09 13:25:36 | ocean-city | set | files:
+ py3k_getpath_v3.patch messages: + msg72854 |
| 2008-09-09 12:38:35 | amaury.forgeotdarc | set | priority: deferred blocker keywords: + needs review |
| 2008-09-09 12:28:31 | amaury.forgeotdarc | set | nosy:
+ amaury.forgeotdarc messages: + msg72852 |
| 2008-09-09 08:42:33 | ocean-city | set | files: + py3k_getpath_v2.patch |
| 2008-09-09 08:39:04 | ocean-city | create | |
