Change by Chris AtLee :
--
pull_requests: +20149
pull_request: https://github.com/python/cpython/pull/20972
___
Python tracker
<https://bugs.python.org/issue12
Chris AtLee added the comment:
It's caused by the combination of the symlink existing, and having the tarfile
opened in r| mode.
If I run the attached test file in a fresh directory, I get the following
exception:
raceback (most recent call last):
File "/home/catlee/.pyenv/versions/
Chris AtLee added the comment:
Is there anything I can do to help get this landed? The PR in github works for
me.
--
nosy: +catlee
___
Python tracker
<https://bugs.python.org/issue12
Chris AtLee added the comment:
Switching this to unified_diff allows the test case to finish nearly instantly.
The downside is that the output is changed in the case of a difference found:
FF
==
FAIL: test_compare (__main__
Changes by Chris AtLee <chris.at...@gmail.com>:
Added file: http://bugs.python.org/file41824/cpython-issue19217.diff
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python
Chris AtLee added the comment:
Thanks, your patch is definitely much simpler!
I was worried about the case where you have interrupted \r\n that appears in
the middle of the content. But that case is handled by the next readline(),
which returns a single \n.
One question about the tests
Chris AtLee added the comment:
To demonstrate how to hit this in a real use case, run the attached script
which implements a simple http server that saves POSTed files to a local file
got_data. It returns the sha1sum of the POSTed file as the http response.
Then, create a test file consisting
New submission from Chris AtLee:
cgi.FieldStorage uses fp.readline(1 16) to read in POSTed file data if no
content length has been specified. All HTTP clients I've looked at terminate
the file body with CRLF and then the final MIME boundary. If the file body is
65,535 bytes, and doesn't
Chris AtLee added the comment:
This is a possible fix to this issue. It's not as clean as I'd like, but the
simpler versions I tried could end up with the entire file contents in memory
for degenerate (or malicious) inputs.
The trick is handling the case where the current line ends with \r
Chris AtLee [EMAIL PROTECTED] added the comment:
The attached patch implements this for python 2.7. It also adds support
for iterable bodies in urllib2, where it is more generally useful.
urllib2 enforces the presence of a Content-Length header in the request
if the body is an iterable
Chris AtLee [EMAIL PROTECTED] added the comment:
I also wrote some software to handle this:
http://atlee.ca/software/poster/poster.encode.html
The reason I wrote this is to avoid having the load the entire file into
memory before posting the request.
This, along with Issue #3243, would allow
New submission from Chris AtLee [EMAIL PROTECTED]:
The BaseHTTPServer docs don't mention 'server' as an instance variable
in the instance variable section for BaseHTTPRequestHandler. It is
mentioned in passing a few paragraphs above in the BaseHTTPServer class
description, but it's too easy
New submission from Chris AtLee [EMAIL PROTECTED]:
httplib should support requests whose bodies are iterable objects. This
would facilitate doing large file uploads via HTTP since you wouldn't
have to load the entire file into memory to create the request string.
Index: Lib/httplib.py
New submission from Chris AtLee [EMAIL PROTECTED]:
The standard library should provide a way to encode data using the
standard multipart/form-data encoding.
This encoding is required to support file uploads via HTTP POST (or PUT)
requests.
Ideally file data could be streamed to the remote
New submission from Chris AtLee [EMAIL PROTECTED]:
Index: Doc/whatsnew/2.6.rst
===
--- Doc/whatsnew/2.6.rst(revision 64571)
+++ Doc/whatsnew/2.6.rst(working copy)
@@ -1284,7 +1284,7 @@
Here are all of the changes
Chris AtLee added the comment:
timedelta.todays() could be useful in general I suppose. I think
timedelta.toweeks() could be omitted since it's simple division by an
easy to recognize constant...also the timedelta docs say that it stores
data in terms of microseconds, seconds, and days.
OTOH
Chris AtLee added the comment:
I keep needing to know the number of seconds that a timedelta represents,
so I implemented the following patch.
This returns only the integer portion, but could be modified to return a
floating point value.
--
nosy: +catlee
Added file: http
17 matches
Mail list logo