On 29 January 2012 21:40, Bináris wikiposta@gmail.com wrote:
The exception is SystemExit: 0 It is caused by line 7813 in the current version:
http://svn.wikimedia.org/viewvc/pywikipedia/trunk/pywikipedia/wikipedia.py?r...
As I mentioned in the previous mail: use 'raise', so that we have the /entire/ stack trace.
This part of handleArgs:
7811 if do_help: 7812 showHelp() 7813 sys.exit(0) 7814 return nonGlobalArgs If I comment 7813 out, it works properly.
Which is incredibly weird, considering the try-except block is inside showHelp, which is a line *above* the sys.exit().
Possibly the problem is caused by a double import - i.e. apispec is first loaded directly, and /then/ as a module (from showHelp), which causes a call to pywikibot.handleArgs() from within the first one.
Again, to confirm this, please post the *entire* stack trace. The solution would then be to make sure pywikibot.handleArgs() is only called when the script runs from the command like (i.e. use a __name__=="__main__" block).
Best, Merlijn