https://bugzilla.wikimedia.org/show_bug.cgi?id=72290
Mpaa <mpaa.wiki(a)gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |mpaa.wiki(a)gmail.com
--- Comment #1 from Mpaa <mpaa.wiki(a)gmail.com> ---
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: 'user-config.py' was not found!
Please follow the prompts to create it:
Traceback (most recent call last):
File "pwb.py", line 162, in <module>
[])
File "pwb.py", line 75, in run_python_file
exec(compile(source, filename, "exec"), main_mod.__dict__)
File "generate_user_files.py", line 19, in <module>
import pywikibot
File "pywikibot/__init__.py", line 29, in <module>
from pywikibot import config2 as config
File "pywikibot/config2.py", line 224, in <module>
_base_dir = get_base_dir()
File "pywikibot/config2.py", line 210, in get_base_dir
raise RuntimeError("Directory '%s' does not exist." % base_dir)
RuntimeError: Directory '/home/user/.pywikibot2' does not exist.
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.
--
You are receiving this mail because:
You are the assignee for the bug.