NameError: global name 'WindowsError' is not defined

Bug #1412015 reported by Ryne Everett on 2015-01-17
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Zope 2

Bug Description

I'm using Plone on linux, and keep getting the following traceback:

Traceback (most recent call last):
  File "/usr/local/Plone/zinstance/parts/instance/bin/interpreter", line 293, in <module>
    exec(compile(, __file__, "exec"))
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/", line 76, in <module>
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/", line 22, in run
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/", line 83, in prepare
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/", line 286, in makeLockFile
    except (IOError, WindowsError):
NameError: global name 'WindowsError' is not defined

WindowsError is used only twice in the project, both times in that file. I know of two ways this could be fixed:

1. Use the more general OSError, from which WindowsError inherits.
2. Use this pattern at the module scope, which you can find in the standard library's shutil module:

except NameError:
    WindowsError = None

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers