Skip to content

Commit b47c37a

Browse files
author
Richard Jones
committed
quick fix for file uploads on windows in roundup.cgi
1 parent 8120784 commit b47c37a

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

cgi-bin/roundup.cgi

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1717
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1818
#
19-
# $Id: roundup.cgi,v 1.18 2001-11-06 22:10:11 jhermann Exp $
19+
# $Id: roundup.cgi,v 1.19 2001-11-22 00:25:10 richard Exp $
2020

2121
# python version check
2222
import sys
@@ -154,7 +154,7 @@ def main(out, err):
154154
request.send_response(200)
155155
request.send_header('Content-Type', 'text/html')
156156
request.end_headers()
157-
w = request.wfile.write
157+
w = request.write
158158
w('<html><head><title>Roundup instances index</title></head>\n')
159159
w('<body><h1>Roundup instances index</h1><ol>\n')
160160
homes = ROUNDUP_INSTANCE_HOMES.keys()
@@ -170,6 +170,11 @@ def main(out, err):
170170
#
171171
out, err = sys.stdout, sys.stderr
172172
try:
173+
# force input/output to binary (important for file up/downloads)
174+
if sys.platform == "win32":
175+
import os, msvcrt
176+
msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
177+
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
173178
checkconfig()
174179
sys.stdout = sys.stderr = LOG
175180
main(out, err)
@@ -185,6 +190,9 @@ LOG.close()
185190

186191
#
187192
# $Log: not supported by cvs2svn $
193+
# Revision 1.18 2001/11/06 22:10:11 jhermann
194+
# Added env config; fixed request wrapper & index list; sort list by key
195+
#
188196
# Revision 1.17 2001/11/06 21:51:19 richard
189197
# Fixed HTTP headers for top-level index in CGI script
190198
#

doc/announcement.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Roundup 0.3.0 - an issue tracking system
22

33
This release contains several new features which will require migration, so
4-
we're releasing this preview for the bleeding-edge users.
4+
please read MIGRATION.txt!
55

66
Big stuff in this release:
77
- lots of bug fixes, thanks to all users for their great feedback!

0 commit comments

Comments
 (0)