Opened 18 years ago
Last modified 9 years ago
#5121 new defect
trac-admin tool stdout flush problem
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | normal | Milestone: | unscheduled |
Component: | admin/console | Version: | |
Severity: | minor | Keywords: | autoflush flush |
Cc: | oren@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
"autoflush" is disabled, and thus when trying to hotcopy to a bad directory I get the following message (note the bad chronological order of the lines):
www-data@web:~$ trac-admin /data/trac/dirstat hotcopy /tmp/bla Command failed: [Errno 17] File exists: '/tmp/bla' Hotcopying /data/trac/dirstat to /tmp/bla ...
I'd suggest modifying the shebang line of trac-admin to "#!/usr/bin/python -u" in order to solve this. (attached as a micro-patch)
Attachments (1)
Change History (7)
by , 18 years ago
Attachment: | trac-admin.patch added |
---|
comment:1 by , 18 years ago
The shebang trick won't work on windows, so if the problem also shows up there (will try), the proposed fix is not OK.
comment:4 by , 16 years ago
Milestone: | → 1.0 |
---|---|
Severity: | normal → minor |
Instead of using python -u
on the shebang line, the following article has several other solutions:
http://stackoverflow.com/questions/107705/python-output-buffering
In particular, the following solutions make the most sense to me:
sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0)
- Call
sys.stdout.flush()
after everywrite()
. This could be done either intrac.admin.console.printout()
or directly intrac.util.text.console_print()
.
comment:6 by , 9 years ago
Owner: | removed |
---|
Patch to address an autoflush issue