Opened 11 years ago
Last modified 11 years ago
#10954 closed defect
'socket.error' object has no attribute 'strerror' on Python 2.5 — at Initial Version
Reported by: | Jun Omae | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | 1.0.1 |
Component: | web frontend/tracd | Version: | 1.0-stable |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
If tracd
on Python 2.5 starts with a used port number, it crashes with the following error.
Error starting Trac server on 0.0.0.0:3000 view at http://127.0.0.1:3000/ Traceback (most recent call last): File "/home/jun66j5/venv/trac/1.0/bin/tracd", line 9, in <module> load_entry_point('Trac==1.0', 'console_scripts', 'tracd')() File "home/jun66j5/venv/trac/1.0/lib/python2.5/site-packages/trac/web/standalone.py", line 335, in main File "home/jun66j5/venv/trac/1.0/lib/python2.5/site-packages/trac/web/standalone.py", line 301, in serve AttributeError: 'error' object has no attribute 'strerror'
socket.error
on Python 2.6+ has an attribute strerror
, however, not on Python 2.5 yet.
http://docs.python.org/2/library/socket.html#socket.error
-
trac/web/standalone.py
diff --git a/trac/web/standalone.py b/trac/web/standalone.py index 7875b3d..09e380d 100755
a b def main(): 298 298 use_http_11=options.http11) 299 299 except socket.error, e: 300 300 print 'Error starting Trac server on %s' % loc 301 print e. strerror301 print e.args[1] 302 302 sys.exit(1) 303 303 304 304 print 'Server starting in PID %i.' % os.getpid()
Note:
See TracTickets
for help on using tickets.