If the directory ~/.pywikibot2 doesnt exist
/path/to/current/dir/ $ python pwb.py -dir:~/.pywikibot2 version
(that path.decode('ascii') looks defective too)
Version: core-(2.0)
Severity: trivial
If the directory ~/.pywikibot2 doesnt exist
/path/to/current/dir/ $ python pwb.py -dir:~/.pywikibot2 version
(that path.decode('ascii') looks defective too)
Version: core-(2.0)
Severity: trivial
Now ~ in argument is resolved.
The exception is raised because the directory does not exist.
But I think this is the wanted behaviour (*).
python pwb.py version -dir:~/.pywikibot2
Note that in you example, it also fails even if the directory exists as -dir: comes before the expected script name.
python pwb.py -dir:~/.pywikibot version
Traceback (most recent call last):
File "pwb.py", line 166, in <module> if len(sys.argv) > 1:
OSError: -dir:~/.pywikibot.py not found!
<type 'exceptions.OSError'>
But if you put it in the expected order, which I guess is the wanted behaviour (**), then this is OK:
python pwb.py version -dir:~/.pywikibot
Pywikibot: [ssh] pywikibot-core.git (182616b, g4347, 2014/10/20, 19:36:09, OUTDATED)
...
Python: 2.7.6 (default, Mar 22 2014, 22:59:38)
[GCC 4.8.2]
unicode test: ok
I think this bug can be closed unless (*) and (**) are not as we would like this to work.
(In reply to Mpaa from comment #1)
Note that in you example, it also fails even if the directory exists as
-dir: comes before the expected script name.python pwb.py -dir:~/.pywikibot version
Traceback (most recent call last):File "pwb.py", line 166, in <module> if len(sys.argv) > 1:OSError: -dir:~/.pywikibot.py not found!
<type 'exceptions.OSError'>
This is 'intentional'. The first parameter after 'pwb.py' MUST be the script you want to execute. Similar to how 'commit' must be directly after 'git' but '--amend' and '-a' after that can be swapped as you like.