Xqt has submitted this change and it was merged.
Change subject: Use unicode base path; fixes https://sourceforge.net/p/pywikipediabot/bugs/1648/ ......................................................................
Use unicode base path; fixes https://sourceforge.net/p/pywikipediabot/bugs/1648/
execfile does not accept unicode paths, so a manual exec open(...).read() will have to take its job.
Change-Id: I9741c9f97e5a66f0d1af012a82f933f493c64066 --- M config.py M fixes.py M wikipediatools.py 3 files changed, 3 insertions(+), 3 deletions(-)
Approvals: Xqt: Looks good to me, approved
diff --git a/config.py b/config.py index ef495ca..cc44c66 100644 --- a/config.py +++ b/config.py @@ -603,7 +603,7 @@ _fileuid = _filestatus[4] if __sys.platform == 'win32' or _fileuid in [os.getuid(), 0]: if __sys.platform == 'win32' or _filemode & 002 == 0: - execfile(_filename) + exec open(_filename, 'r').read() else: print "WARNING: Skipped '%s': writeable by others."%_filename else: diff --git a/fixes.py b/fixes.py index 4923410..58cbcfa 100644 --- a/fixes.py +++ b/fixes.py @@ -669,6 +669,6 @@ import config
try: - execfile(config.datafilepath(config.base_dir, "user-fixes.py")) + exec open(config.datafilepath(config.base_dir, "user-fixes.py"), 'r').read() except IOError: pass diff --git a/wikipediatools.py b/wikipediatools.py index 7af8cb7..baefa51 100644 --- a/wikipediatools.py +++ b/wikipediatools.py @@ -41,7 +41,7 @@ print sys.modules base_dir = '.' if not os.path.isabs(base_dir): - base_dir = os.path.normpath(os.path.join(os.getcwd(), base_dir)) + base_dir = os.path.normpath(os.path.join(os.getcwdu(), base_dir)) # make sure this path is valid and that it contains user-config file if not os.path.isdir(base_dir): raise RuntimeError("Directory '%s' does not exist." % base_dir)
pywikibot-commits@lists.wikimedia.org