Fixing a WindowsError in Qooxdoo’s generate.py
divendres, juny 24th, 2011eyeOS 2.5 uses Qooxdoo 1.3. For my project I needed to include the SVG contrib by Marc Puts, so I checked if there was an easy way to do this in eyeOS.
A step in this process is calling generate.py, which is quite simple but wouldn’t finish on my laptop. Well, it happened to be a bug with a very quick patch. I sent a bug report and it has been fixed for trunk and branch 1.4.x.
Under certain circumstances generate.py can't finish its job.
I tried to build an app with
generate.py build
where build is a job defined in our (eyeOS) custom config.json
It failed with the message "global name 'WindowsError' is not defined".
The program was attempting to copy some files and the destination folder's
owner was somebody with higher privileges.
The affected file is qooxdoo-sdk/tool/pylib/misc/copytool.py
line 82:
except WindowsError:
try:
os.chmod(targetPath, stat.S_IWUSR)
WindowsError is a subclass of OSError, as stated in
http://docs.python.org/library/exceptions.html#exceptions.WindowsError
"it's raised when a Windows-specific error occurs or when the error number does
not correspond to an errno value"
I suggest changing WindowsError for OSError.
I'm running Fedora 14 (2.6.35.13-92.fc14.i686)
Python 2.7 (r27:82500, Sep 16 2010, 18:03:06)
Steps to reproduce
1. get a working qooxdoo app
2. set its owner to somebody but yourself (e.g. chown apache:apache -R myApp/ )
3. run generate.py
