Page MenuHomePhabricator

Invalid token for os.makedirs in generate_user_files.py
Closed, ResolvedPublic

Description

This bug is reported by ytrezq in IRC

I can't run setup.py successfully.
It there's several built-in os functions for installing it :

reading manifest file 'Pywikipediabot.egg-info\SOURCES.txt'
writing manifest file 'Pywikipediabot.egg-info\SOURCES.txt'
Copying Pywikipediabot.egg-info to C:\Program Files\Python34\Lib\site-packages\Pywikipediabot-2.0b1-py3.4.egg-info
running install_scripts

File "generate_user_files.py", line 58
  os.makedirs(base_dir, mode=0700)
                                ^

SyntaxError: invalid token

os.makedirs(base_dir, mode=0700) is for Unix systems, and I'm using windows so it don't work.

The error occures while running setup.py with python 3.4 in windows environment


Version: core-(2.0)
Severity: major

Details

Reference
bz65675

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 3:17 AM
bzimport set Reference to bz65675.
Xqt created this task.May 23 2014, 12:28 PM

While I don't know how 'mode' behaves on Windows machines, the error is a different one (which has been fixed): In Python 3 the octal mode requires to begin with '0o' while Python 2 also accepted just '0'. The current version is already using '0o' so at least this specific error shouldn't happen.

See alse: https://docs.python.org/3.0/whatsnew/3.0.html#integers

XZise closed this task as Resolved.Nov 28 2014, 9:31 AM

Okay here is what happens in Python 3.3:

Python 3.3.0 (default, Aug 28 2014, 16:59:28) 
[GCC 4.8.3 20140624 (Red Hat 4.8.3-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 0700
  File "<stdin>", line 1
    0700
       ^
SyntaxError: invalid token

Which is exactly the error described, as that is fixed this bug is fixed (at least the result you describe). If it still does not work on Windows with Python 3 feel free to reopen the bug with the actual error message.

Note this task was created in May, when py3 support was not available.
I have tested generate_user_files now using py3.3 & py3.4 on Windows 7, and it works correctly except for a py3 bug in the terminal interface (T76236)

jayvdb set Security to None.