[Python-Dev] [patch] moving file load to AFTER Py_Initialize performed (original) (raw)
Luke Kenneth Casson Leighton luke.leighton at googlemail.com
Fri Jan 16 00:08:20 CET 2009
- Previous message: [Python-Dev] Lib/email/header.py ecre regular expression
- Next message: [Python-Dev] multiprocessing vs. distributed processing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
http://bugs.python.org/issue4956
uhn... weird bug, totally left-field scenario (using python under msys under wine under linux) but this rather strange scenario has a situation where loading the filename from the command line cannot be done until after PyInitialize is called. prior to PyInitialize() being called, file handling including stderr is so screwed that it's impossible to even use sprintf(stderr, "help help there's something wrong!\n") to diagnose the problem.
i wanted to ask people: does this patch (in #4956) look... reasonable?
there's no global variables or subtle interaction that "steals" argv or argc (as part of PyInitialize()) is there, that would, once it's finished, disrupt the loading of the file?
if so, it would be necessary to split up the code that "gets" the filename (filename = argv[_PyOS_optind]) and leave that bfore PyInitialize(), from the code that loads the file (into fp).
following the deployment of this fix, the build of python under msys+wine+linux proceeds from msys, rather than having to be irritatingly interrupted and continued from "wineconsole cmd".
l.
- Previous message: [Python-Dev] Lib/email/header.py ecre regular expression
- Next message: [Python-Dev] multiprocessing vs. distributed processing
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]