Modify ↓
#10954 closed defect (fixed)
'socket.error' object has no attribute 'strerror' on Python 2.5
| Reported by: | Jun Omae | Owned by: | Jun Omae |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0.1 |
| Component: | web frontend/tracd | Version: | 1.0-stable |
| Severity: | minor | Keywords: | |
| Cc: | Branch: | ||
| Release Notes: |
Correctly handle |
||
| 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()
Attachments (0)
Change History (3)
comment:1 by , 13 years ago
comment:2 by , 13 years ago
| Release Notes: | modified (diff) |
|---|---|
| Resolution: | → fixed |
| Status: | new → closed |
Fixed in [11471-11472].
comment:3 by , 13 years ago
| Owner: | set to |
|---|
Note:
See TracTickets
for help on using tickets.



Jun, don't hesitate to commit such fixes directly. The ticket is nice for documentation.