Index: trunk/pywikipedia/wikipedia.py |
— | — | @@ -7688,6 +7688,10 @@ |
7689 | 7689 | return os.path.basename(called) |
7690 | 7690 | |
7691 | 7691 | def _decodeArg(arg): |
| 7692 | + # We may pass a Unicode string to a script upon importing and calling |
| 7693 | + # main() from another script. |
| 7694 | + if isinstance(arg,unicode): |
| 7695 | + return arg |
7692 | 7696 | if sys.platform == 'win32': |
7693 | 7697 | if config.console_encoding in ('cp437', 'cp850'): |
7694 | 7698 | # Western Windows versions give parameters encoded as windows-1252 |