NameError: global name 'WindowsError' is not defined
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/
exec(
File "/usr/local/
run()
File "/usr/local/
starter.
File "/usr/local/
self.
File "/usr/local/
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
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/zopefoundat ion/zope2.