NameError: global name 'WindowsError' is not defined

Bug #1412015 reported by Ryne Everett
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Zope 2
Invalid
Undecided
Unassigned

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__f.read(), __file__, "exec"))
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/run.py", line 76, in <module>
    run()
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/run.py", line 22, in run
    starter.prepare()
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/__init__.py", line 83, in prepare
    self.makeLockFile()
  File "/usr/local/Plone/buildout-cache/eggs/Zope2-2.13.22-py2.7.egg/Zope2/Startup/__init__.py", 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:

try:
    WindowsError
except NameError:
    WindowsError = None

Revision history for this message
Colin Watson (cjwatson) wrote :

The zope2 project on Launchpad has been archived at the request of the Zope developers (see https://answers.launchpad.net/launchpad/+question/683589 and https://answers.launchpad.net/launchpad/+question/685285). If this bug is still relevant, please refile it at https://github.com/zopefoundation/zope2.

Changed in zope2:
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.