[Pywikipedia-l] SVN: [5717] trunk/pywikipedia/wikipedia.py
russblau at svn.wikimedia.org
russblau at svn.wikimedia.org
Mon Jul 14 13:49:03 UTC 2008
Revision: 5717
Author: russblau
Date: 2008-07-14 13:49:02 +0000 (Mon, 14 Jul 2008)
Log Message:
-----------
Fix bug 2009004 (Log file location not set consistently on Windows)
Modified Paths:
--------------
trunk/pywikipedia/wikipedia.py
Modified: trunk/pywikipedia/wikipedia.py
===================================================================
--- trunk/pywikipedia/wikipedia.py 2008-07-14 11:06:30 UTC (rev 5716)
+++ trunk/pywikipedia/wikipedia.py 2008-07-14 13:49:02 UTC (rev 5717)
@@ -5806,9 +5806,9 @@
args = sys.argv
try:
# clip off the '.py' filename extension
- return args[0][:args[0].rindex('.')]
+ return os.path.basename(args[0][:args[0].rindex('.')])
except ValueError:
- return args[0]
+ return os.path.basename(args[0])
def decodeArg(arg):
if sys.platform=='win32':
@@ -6110,9 +6110,9 @@
logs/commands.log so that the user can look it up later to track errors
or report bugs.
"""
+ modname = os.path.basename(sys.argv[0])
# put quotation marks around all parameters
- args = [decodeArg(sys.argv[0])
- ] + [decodeArg('"%s"' % s) for s in sys.argv[1:]]
+ args = [decodeArg(modname)] + [decodeArg('"%s"' % s) for s in sys.argv[1:]]
commandLogFilename = config.datafilepath('logs', 'commands.log')
try:
commandLogFile = codecs.open(commandLogFilename, 'a', 'utf-8')
More information about the Pywikipedia-l
mailing list