I noticed that if I start interwiki.py with the command "interwiki.py -log ..." on Windows XP, its log file interwiki.log is created in the pywikipedia root directory, e.g. C:\svn\pywikipedia\interwiki.log.
However, if I use the command "python interwiki.py -log ...", the log file is properly created in the logs subdirectory, e.g. C:\svn\pywikipedia\logs\interwiki.log.
This is caused by the fact that sys.argv[0] is different depending on how you start interwiki.py: "interwiki.py" sets sys.argv[0] to "C:\svn\pywikipedia\interwiki.py", while "python interwiki.py" sets it to "interwiki.py" without the path. The function calledModuleName() in wikipedia.py uses sys.argv[0] to determine the module name, and setLogfileStatus() uses the module name to construct the log file name.
Can we use os.path.basename() in calledModuleName() to normalize the module name, or would this break something else?
Log file location fix for wikipedia.py r5664
Logged In: YES
user_id=855050
Originator: NO
fixed in r5717