[Moin-devel] [ moin-Bugs-664589 ] forced binary stdout/stderr confuses some servers
SourceForge.net
noreply at sourceforge.net
Mon Jun 7 08:55:07 EDT 2004
Bugs item #664589, was opened at 2003-01-08 20:36
Message generated for change (Comment added) made by thomaswaldmann
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108482&aid=664589&group_id=8482
Category: None
Group: None
>Status: Closed
>Resolution: Rejected
Priority: 5
Submitted By: Chuck Adams (skeptopotamus)
Assigned to: Nobody/Anonymous (nobody)
Summary: forced binary stdout/stderr confuses some servers
Initial Comment:
I'm serving moin with tinyweb, and was being driven
insane by seeing no output produced by the script, even
when I wrapped everyting in try/catch and even forced a
text/plain header as the very first line of the cgi driver. I
looked into cgimain.py and saw these suspicious
looking lines:
if sys.platform == "win32" and not properties.get
('standalone', 0):
import msvcrt
msvcrt.setmode(sys.stdin.fileno(), os.O_BINARY)
msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
Commenting them out fixed the problem. This sort of os-
level fiddling really needs to be a configuration item, and
broken out into a module like "platformhacks.py"
----------------------------------------------------------------------
>Comment By: Thomas Waldmann (thomaswaldmann)
Date: 2004-06-07 17:54
Message:
Logged In: YES
user_id=100649
JosHyakugeiYule tested apache and moin without O_BINARY and
it broke binary uploads (Apache 1.3.29, Windows XP Home,
Python 2.3.1).
Description of O_BINARY:
"Set the line-end translation mode for the file descriptor
fd. To set it to text mode, flags should be os.O_TEXT; for
binary, it should be os.O_BINARY."
So as we can't know before what we get, we have to switch it
to BINARY to avoid data corruption.
I can't explain why it didn't work for you, but if we remove
that, it would break apache and attachments at least.
Further I am not even sure if it was the right fix for your
problem - as it maybe broke attachments for you, too.
If I am wrong, please tell me and reopen the bug.
----------------------------------------------------------------------
Comment By: Thomas Waldmann (thomaswaldmann)
Date: 2004-03-27 15:43
Message:
Logged In: YES
user_id=100649
As long as there is no developer working and testing with
win32, this is unlikely to get changed.
Most (if not all) current developers use linux or BSD or Mac
OS X as development platform, so if we would change anything
relating to win32 only, we couldn't even test it.
So we better don't change anything there and leave it to
people who can also test those changes.
If you can work out a patch definitely working for tinyweb,
IIS and apache, please do.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=108482&aid=664589&group_id=8482
More information about the Moin-devel
mailing list