[issue1033] Support for newline and encoding in tempfile module

2007-08-26 Thread Adam Hupp

New submission from Adam Hupp:

It would be useful for tempfile.TemporaryFile and friends to pass
newline and encoding arguments to the underlying io.open call.  For
example, several tests in test_csv use TemporaryFile and need to handle
unicode file output or preserve exact newlines.  This is simpler with
direct support in TemporaryFile.

The attached patch makes the following changes:

 1) tempfile.TemporaryFile, NamedTemporaryFile, and SpooledTemporaryFile
 now pass newline and encoding to the underlying io.open call.
 2) test_tempfile is updated
 3) test_csv is updated to use the new arguments.

--
components: Library (Lib)
files: tempfile-newline-encoding.patch
messages: 55328
nosy: hupp
severity: normal
status: open
title: Support for newline and encoding in tempfile module
type: rfe
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1033>
__

tempfile-newline-encoding.patch
Description: Binary data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1033] Support for newline and encoding in tempfile module

2007-08-26 Thread Adam Hupp

Adam Hupp added the comment:

One change I forgot to mention that may need discussion.  I've changed
the 'bufsize' arguments in tempfile to 'buffering', since that is
consistent with the same change in os.fdopen.

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1033>
__
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1373] turn off socket timeout in test_xmlrpc

2007-11-02 Thread Adam Hupp

New submission from Adam Hupp:

The attached patch resolves the intermittent test_xmlrpc failures
reported by Neal Norwitz[0].

test_xmlrpc starts the XMLRPC server with a socket timeout.  This puts
the socket into non-blocking mode which is incompatible with the use of
socket.makefile as used by SocketServer.  To work around this the test
was specifically ignoring temporary read errors but the ignore was no
longer working.

The patch resolves this by removing the call to socket.settimeout and
the code to ignore temporary read errors.  
 
I also had to change the `numrequests' parameter in
FailingServerTestCase from 2->1.  This test case only makes a single
request per test (like the others) so numrequests=2 caused the test to hang.

[0]http://mail.python.org/pipermail/python-3000/2007-October/011073.html

--
components: Tests
files: xmlrpc_nonblock.patch
messages: 57048
nosy: hupp
severity: normal
status: open
title: turn off socket timeout in test_xmlrpc
versions: Python 3.0
Added file: http://bugs.python.org/file8677/xmlrpc_nonblock.patch

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1373>
__

xmlrpc_nonblock.patch
Description: Binary data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue1380] fix for test_asynchat and test_asyncore on pep3137 branch

2007-11-03 Thread Adam Hupp

New submission from Adam Hupp:

The attached patch resolves test failues in test_asynchat and
test_asyncore.

The asynchat failure was due to interpolating a byte string into a
unicode string using %s.  This resulted in a b'' byte representation
in the final string.  The fix is to use string constants instead of
byte constants.  The result is encoded to bytes later on.

The asyncore failure was due to an explicit isinstance(data, bytes)
check on the result of recv.  The actual type in this case was buffer.
I've removed the check since the next line calls

data.replace(b'\n', b'')

This all should fail for anything thats not a buffer or bytes.

--
components: Library (Lib), Tests
files: pep3137-asynfix.patch
messages: 57086
nosy: hupp
severity: normal
status: open
title: fix for test_asynchat and test_asyncore on pep3137 branch
type: behavior
versions: Python 3.0
Added file: http://bugs.python.org/file8684/pep3137-asynfix.patch

__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1380>
__

pep3137-asynfix.patch
Description: Binary data
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com