Modify

Opened 9 years ago

Closed 9 years ago

#251 closed defect (fixed)

NameError prevents script from running

Reported by: kofal002@… Owned by: bas
Priority: major Milestone: New email2trac release 2.4.0
Component: email2trac Version: 2.1.0
Keywords: Cc:

Description

With the latest version of Email2Trac on Windows Server 2008 r2 and Python 2.7.1 (with Windows Extensions installed), I get this error:

Traceback (most recent call last):
  File "C:/.../Email2Trac/email2trac.py", line 2382, in <module>
    logger = setup_log(settings, os.path.basename(settings.project), debug_interactive)
  File "C:/.../Email2Trac/email2trac.py", line 2281, in setup_log
    log_handler = logging.handlers.NTEventLogHandler(logid, logtype='Application')
NameError: global name 'logid' is not defined

The phrase "logid" appears nowhere else in the script. I tried just changing "logid" to 1 and got a different error:

Traceback (most recent call last):
  File "C:/.../Email2Trac/email2trac.py", line 2382, in <module>
    logger = setup_log(settings, os.path.basename(settings.project), debug_interactive)
  File "C:/.../Email2Trac/email2trac.py", line 2281, in setup_log
    log_handler = logging.handlers.NTEventLogHandler(1, logtype='Application')
  File "C:\Python27\lib\logging\handlers.py", line 917, in __init__
    self._welu.AddSourceToRegistry(appname, dllname, logtype)
  File "C:\Python27\lib\site-packages\win32\lib\win32evtlogutil.py", line 35, in AddSourceToRegistry
    "SYSTEM\\CurrentControlSet\\Services\\EventLog\\%s\\%s" % (eventLogType, appName))
pywintypes.error: (5, 'RegCreateKey', 'Access is denied.')

Changing this to a different log type prevents this from happening. Instead of ending on a fatal error, perhaps if Windows logging does not work, default to a local log file instead?

Attachments (0)

Change History (2)

comment:1 Changed 9 years ago by bas

  • Milestone set to New email2trac release 2.X.X
  • Status changed from new to assigned

comment:2 Changed 9 years ago by bas

  • Resolution set to fixed
  • Status changed from assigned to closed

(In [532]) fix a bug in the windows logging environment, closes #251

Add Comment

Modify Ticket

Change Properties
Action
as closed The owner will remain bas.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.