Changes by Martin Panter vadmium...@gmail.com:
--
keywords: +patch
Added file: http://bugs.python.org/file38042/http-attributes.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23410
Martin Panter added the comment:
See also Issue 23285 for the PEP
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18885
___
___
Python-bugs-list
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23285
___
___
Python-bugs-list
Martin Panter added the comment:
Currently the log output includes the new HTTPStatus codes. I don’t care much
for the log output, but perhaps this wasn’t part of the plan? Before:
$ python3.4 -m http.server
Serving HTTP on 0.0.0.0 port 8000 ...
127.0.0.1 - - [08/Feb/2015 05:05:28] GET / HTTP
Martin Panter added the comment:
If it would help the review process, I could simplify my patch by dropping the
addition of the HTTPConnection.closed flag, so that it just adds the
ConnectionClosed exception. Looking forwards, I’m wondering if it might be
better to add something like
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18885
___
___
Python-bugs-list
Martin Panter added the comment:
Here is a patch to redocument the constructor arguments. I am assuming that
they were only removed by accident. The constructor arguments are already
tested in ExceptionTests.testAttributes() at Lib/test/test_exceptions.py:248.
I did not restore the bit about
Martin Panter added the comment:
The error fix patch looks good.
I updated the doc patch as fix_doc_binascii_unhexlify.v2.patch, which also
clarifies a2b_qp(), and restores the description of Python 3.2 not allowing
text strings.
--
assignee: - docs@python
components: +Documentation
Changes by Martin Panter vadmium...@gmail.com:
Added file: http://bugs.python.org/file38045/urllib.parse-all.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23411
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3213
___
___
Python-bugs-list
Changes by Martin Panter vadmium...@gmail.com:
Removed file: http://bugs.python.org/file38044/urllib.parse-all.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23411
New submission from Martin Panter:
+DefragResult, ParseResult, SplitResult,
+DefragResultBytes, ParseResultBytes, SplitResultBytes]
Also adds test case.
--
components: Library (Lib)
files: urllib.parse-all.patch
keywords: patch
messages: 235556
nosy: vadmium
priority: normal
severity
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12304
___
___
Python-bugs-list
Martin Panter added the comment:
See also PEP 475 and Issue 23285 for the general fix in Python 3
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue20611
Martin Panter added the comment:
I don’t understand where the work needs to be done for this one. Even in the
3.1 and 2.7 documentation, the urlparse() and urlsplit() entries both list
“port” as one of the returned attributes, and urlparse() has example code for
it.
--
nosy: +vadmium
Martin Panter added the comment:
Fixing Issue 22852 or Issue 5843 should help fixing this.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15009
New submission from Martin Panter:
Here is a patch that adds the Simple/CGIHTTPRequestHandler classes to __all__,
and a test case that should help keep it up to date in the future.
--
components: Library (Lib)
files: http.server-all.patch
keywords: patch
messages: 235594
nosy: vadmium
Martin Panter added the comment:
The relevant code looks like it is _parse_proxy() at Lib/urllib/request.py:693.
It has custom code to search for a slash (/), so it wouldn’t be hard to make it
search after the last at (@) symbol. (I previously assumed it would use
urlsplit() or similar, which
Martin Panter added the comment:
Issue 22755 is about the example arms race for contextlib.closing().
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12955
Martin Panter added the comment:
A different test case for “unused_data” attribute was added in 2012 for Issue
16350, so that part is no longer needed.
If this feature goes ahead, it might be nice to also update the bzip and LZMA
modules for consistency.
In Python 3, the equivalent
Martin Panter added the comment:
I opened Issue 23231 about fixing iterencode() and iterdecode() in the general
case. I added a patch to Issue 13881 to fix StreamWriter for zlib and bz2, and
to fix StreamWriter.writelines() in general.
I am adding a patch here to clarify the StreamReader API
Martin Panter added the comment:
My “master plan” is basically to make most of the bytes-to-bytes codecs work as
documented in the incremental (stateful) modes. I’m less interested in fixing
the text codecs, and the quopri and uu codecs might be too hard, so I was going
to propose some
Martin Panter added the comment:
Sorry, I changed the name of the attribute and forgot to update the doc string.
Its new name was _Encoder.
Your description was fairly accurate. I am adding patch v3, with an expanded
the doc string. Hopefully that explains it a bit better. Since it is just
Martin Panter added the comment:
Hi Demian, my intention is to demonstrate normal usage of Python’s HTTP client,
whether or not its implementation misbehaves. I am trying to demonstrate a
valid persistent server that happens to decide to close the connection after
the first request but before
Martin Panter added the comment:
Calling self.wfile.write(b) should be equivalent to not calling write() at
all, as far as I understand. Using strace, it does not seem to invoke send() at
all. So the result will depend on what is written next. In the case of my code,
nothing is written next
Martin Panter added the comment:
Here is patch v2, which fixes some more bugs I uncovered in the
quoted-printable encoders:
* The binascii version would unnecessarily break a 76-character line (maximum
length) if it would end with an =XX escape code
* The native Python version would insert
Martin Panter added the comment:
Would also be good to document that errors='ignored' is not allowed. Currently
the documentation says
The following string values are defined and implemented by all standard Python
codecs:
* 'strict'
* 'ignore
Martin Panter added the comment:
Is this patch likely to go ahead? It has been sitting around a while and would
conflict with patches I am working on.
If so, I reckon it would be good to factor out some of the new bits of code
(_check_strict, _StrictErrors) into a common place, like
Martin Panter added the comment:
Personally I don’t have a problem with the names; I would consider str(),
bytes(), bytearray() types all to be “strings”. However there is precedent in
the “base64” module for renaming to en/decodebytes(); see Issue 3613.
--
nosy: +vadmium
Martin Panter added the comment:
Three slightly different points here:
1. Decoding trailing whitespace: My understanding is quoted-printable encoding
aims to be tolerant of whitespace being added to and removed from the end of
encoded lines. So I assume the “binascii” module is wrong to leave
Martin Panter added the comment:
Regarding decoding trailing whitespace,
https://tools.ietf.org/html/rfc1521.html#section-5.1 rule #3 says:
“When decoding a Quoted-Printable body, any trailing white space on a line must
be deleted, as it will necessarily have been added by intermediate
Martin Panter added the comment:
The Lib/xmlrpc/client.py file appears to already support compression using
“Content-Encoding: gzip”. Perhaps it could be leveraged for any work on this
issue.
--
___
Python tracker rep...@bugs.python.org
http
Martin Panter added the comment:
Yeah I’m happy to put a patch together, once I have an idea of the details.
I’d also like to understand your scenario that would mislead the user to
believe that the connection has been closed when it actually hasn’t. Can you
give a concrete example
Martin Panter added the comment:
But () is the odd one out if you consider
[a, b] = range(2)
[] = range(0)
(a, b) = range(2)
() = range(0)
File stdin, line 1
SyntaxError: can't assign to ()
--
nosy: +vadmium
___
Python tracker rep
Martin Panter added the comment:
Just noticed the new documentation says “http.HTTPStatus.OK is also available
as . . . http.server.OK”. I think this is wrong; only the client module (and
now the top-level package) have those constants. The enum values are only
available in the server module
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18022
___
___
Python-bugs-list
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23255
___
___
Python-bugs-list
Martin Panter added the comment:
Another idea that doesn’t involve changing the incremental codec APIs is kind
of described in https://bugs.python.org/issue7475#msg145986: to add format
parameters to iterencode() and iterdecode(), which would allow it to determine
the right data type
Martin Panter added the comment:
Here is a patch that clarifies in the documentation and test suite how newlines
work in the “quopri” and “binascii” modules. It also fixes the native Python
implementation to support CRLFs.
* \n is used by default (e.g. for soft line breaks if the input has
Martin Panter added the comment:
I believe the BadStatusLine can still happen, depending on the circumstances.
When I get a chance I will see if I can make a demonstration. In the meantime
these comments from my persistent connection handler
https://github.com/vadmium/python-iview/blob
Martin Panter added the comment:
New patch that also fixes StreamWriter.writelines() in general for the byte
codecs
--
Added file: http://bugs.python.org/file37710/zlib-bz2-writer.v2.patch
___
Python tracker rep...@bugs.python.org
http
Martin Panter added the comment:
What about instead of
'''
Whether changes to one are reflected in the other after the call returns is
undefined; additionally, the dictionary may change unpredictably after the
call, and how it does is implementation-specific.
'''
substitue this wording
Martin Panter added the comment:
For the record, this is related to PEP 455 (key-transforming dictionary)
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18986
Martin Panter added the comment:
Spotted code in Python’s own library that maintains a persistent connection and
works around this issue:
Lib/xmlrpc/client.py:1142
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3566
Martin Panter added the comment:
I would support adding ENOTCONN under the ConnectionError umbrella. It is
caught for shutdown() calls in a few standard library modules. Here is a demo
showing how to trigger it (at least on Linux):
from socket import create_connection, SHUT_RDWR
from
New submission from Martin Panter:
$ python3 -c 'import codecs; from io import BytesIO;
codecs.getwriter(big5)(BytesIO()).reset()'
Segmentation fault (core dumped)
[Exit 139]
Happens for all the multibyte codecs:
broken_stream_codecs = {
big5, big5hkscs, cp932, cp949, cp950,
euc_jp
Martin Panter added the comment:
There is a flaw with inheriting the readline() method in my patch, and I have
decided to give up fixing the StreamReader classes. I did update the
documentation in my copy of the patch based on Marc-Andre Lemburg’s feedback if
anyone is interested
Martin Panter added the comment:
There is also a new sentence about the GIL at the end, but leaving the
inbetween lines as they were would verify this
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23251
Martin Panter added the comment:
What I have sometimes done in this situation is just break the overly long line
into two short lines
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23251
Martin Panter added the comment:
The post makes a bit more sense once you realize the dotted numbers refer to
old section numbers (which have moved on now):
20.19.2 → “Server Objects” section
20.19.1 → “Server Creation Notes”
Regarding point 2: Instructions for the user to make a threading
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14307
___
___
Python-bugs-list
Changes by Martin Panter vadmium...@gmail.com:
--
title: FD leak in SocketServer - FD leak in SocketServer when request handler
throws exception
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1429
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue13354
___
___
Python-bugs-list
Martin Panter added the comment:
Adding issue15955_lzma_r5.diff. Main changes from r4:
* Consistent Py_ssize_t type for data_size
* max_size → max_length to match Python parameter name
* Arranged for EOF handling to occur before, and instead of, saving the input
buffer
* Removed my LZMAFile
New submission from Martin Panter:
Running the example from the Asynchronous Mixins section of the “socketserver”
documentation generates a ResourceWarning:
$ ./python -btWall ThreadedTCPServer.py
Server loop running in thread: Thread-1
Received: Thread-2: Hello World 1
Received: Thread-3
Martin Panter added the comment:
Okay here is a demonstration script, which does two tests: a short basic GET
request, and a 2 MB POST request. Output for me is usually:
Platform: Linux-3.15.5-2-ARCH-x86_64-with-arch
Normal request: getresponse() raised BadStatusLine('',)
2 MB request: request
Martin Panter added the comment:
For what it’s worth, both io.TextIOWrapper and _pyio.TextIOWrapper appear to
only ever call IncrementalEncoder.setstate(0). And the newline _decoder_ is not
relevant because it doesn’t use any _encoder_.
--
nosy: +vadmium
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23302
___
___
Python-bugs-list
Martin Panter added the comment:
Actually, maybe I should add all those status codes as well, like
http.client.OK. Will probably require different patches for 3.4 and 3.5.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Martin Panter added the comment:
I’m no IPv6 expert, but there seems to be a few standards:
* https://tools.ietf.org/html/rfc6874 (Feb 2013). Encodes as
http://[fe80::1%25eth0]/; says Windows uses this form. Also mentions the
unencoded http://[fe80::1%eth0]/ form. Says that the HTTP Host
Martin Panter added the comment:
See Issue 8583 for a proposal that would apparently allow all namespaces to be
ignored
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18304
Martin Panter added the comment:
Also Issue 18304 for more discussion on simplifying namespaces
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8583
Martin Panter added the comment:
I will be interested to see those reasons. Another way to do a similar thing
might be using a Key(value, transform) class, somewhat along the lines of Issue
20632, but as a separate class rather than part of the core type system. But I
have not thought
Martin Panter added the comment:
My guess is you could make it work by adding a __format__ method to your custom
class.
def __format__(self, format_spec):
return format(float(self), format_spec)
--
nosy: +vadmium
___
Python tracker rep
Martin Panter added the comment:
It returns a string, and the print statement/function prints the contents of
that string. Perhaps you are confused between JSON strings, which appear in the
output, and Python strings, which hold the characters to output.
--
nosy: +vadmium
Martin Panter added the comment:
Using fileobj=sys.stdin.buffer instead should do the trick. The “tarfile”
module would expect a binary stream, not a text stream.
Given the documentation currently says, “Use this variant in combination with
e.g. sys.stdin, . . .”, I presume that is why you
Martin Panter added the comment:
Posting patch v2:
* Changed readinto() argument descriptions to “a pre-allocated, writable
bytes-like buffer”, for both RawIOBase and BufferedIOBase
* Integrated the single-use test_memoryio.BytesIOMixin test class, which
tricked me when I did the first patch
Martin Panter added the comment:
Thanks. Confirming the patch fixes the problem for me, so should be comitted. I
wonder if a test case would be good too though.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23442
Martin Panter added the comment:
I don’t have a strong opinion about changing __all__ in these cases. I only
noticed the potential problem when I went to add a new class to the module, and
thought this was common practice. If we leave it as it is, it would be good to
add comment in the source
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17986
___
___
Python-bugs-list
Martin Panter added the comment:
The length of an encoded Latin-1 string should equal the length of the
unencoded text string, since it is a one-to-one character-to-byte encoding. So
encoding should not actually be needed to determine the Latin-1 encoded length.
Though I’m not particularly
Martin Panter added the comment:
One interesting question is how to convey data to the chunked encoder. There
are two sets of options in my mind, a pull interface:
* iterable: seems to be the popular way amoung commenters here
* file reader object: encoder calls into stream’s read() method
Martin Panter added the comment:
Posting another patch which hopefully explains the “requestline” attribute a
bit better. Let me know if you have any ideas for better wording.
--
Added file: http://bugs.python.org/file38141/http-attributes.v2.patch
Martin Panter added the comment:
Looking at this again, I think I should make the forking server’s
handle_error() method only be called for Exception subclasses as well. So I am
posting a new patch that also does this.
--
Added file: http://bugs.python.org/file38144/socketserver
Martin Panter added the comment:
Posting a patch for this so that we can get rid of the broken
HTTPMessage.getallmatchingheaders() method in Issue 5053.
--
keywords: +patch
nosy: +vadmium
Added file: http://bugs.python.org/file38142/cgi-accept.patch
Martin Panter added the comment:
Posting a patch to remove the entire HTTPMessage class. This assumes my patch
for Issue 5054 is accepted, which will remove the only existing reference to
getallmatchingheaders().
--
Added file: http://bugs.python.org/file38143/remove-HTTPMessage.patch
Martin Panter added the comment:
Closely related:
* Issue 16349: document byte string format argument support
* Issue 21071: should the Struct.format property be bytes or text?
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http
Martin Panter added the comment:
But it is not natural to do things like this (based on headers sent by Firefox):
putheader(User-Agent, Mozilla/5.0, (X11;, Linux, x86_64;, rv:25.0),
Gecko/20100101, Firefox/25.0)
putheader(Accept-Encoding, gzip,, deflate)
A way to properly encode different
Martin Panter added the comment:
I don’t have a Solaris to test this, but maybe changing the first half of the
test to the following would work:
dir = tempfile.TemporaryDirectory()
self.addCleanup(dir.cleanup) # In case removal after chdir() fails
self.addCleanup(os.chdir, os.getcwd
Martin Panter added the comment:
Posting patch v3. It is based on Demian’s suggested wording for the requestline
attribute, but adjusted to match the other entries, and to mention the empty
string.
--
Added file: http://bugs.python.org/file38157/http-attributes.v3.patch
Martin Panter added the comment:
I think the patch for Issue 12067 covers all of the suggested points here, and
is more accurate in some cases.
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22000
Martin Panter added the comment:
I guess you saying RemoteDisconnected effectively means the same thing as
ConnectionResetError. Would it help if it was derived from
ConnectionResetError, instead of the ConnectionError base class? Or are you
also worried about the multiple inheritance
Martin Panter added the comment:
Posting v3 patch that changes from a list to a set of expected API names
--
Added file: http://bugs.python.org/file38180/http.client-all.v3.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Martin Panter added the comment:
Posting patch v3; thanks for the reviews!
* Changed “buffer” → “object”
* Made it clearer that the bytes-like object generalization only applies to
method arguments, not return values
* Minor fixes to wording
--
Added file: http://bugs.python.org
Martin Panter added the comment:
Issue 4395 is already open for the != delegating to __eq__ issue that Guido
pointed out earlier.
Yet another issue that this doc patch should solve: Issue 22000.
I am posting v13 of the patch that works with the current “default” (3.5)
branch. Minor
Martin Panter added the comment:
Using len(b) is fine if b is a bytes() or bytearray() object, but a bytes-like
object can be anything that you can pass to memoryview(). In general len(b) is
not part of that protocol, so can return some other value, or even be
unimplemented:
from array
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14465
___
___
Python-bugs-list
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue23342
___
___
Python-bugs-list
Martin Panter added the comment:
Documenting the “headers” attribute is also discussed in Issue 12707
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue22989
Martin Panter added the comment:
Related: Issue 12707, about deprecating some methods in favour of attributes
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21228
Martin Panter added the comment:
I think it would be okay to deprecate the methods in the documentation, but
they should not be removed nor trigger warnings any time soon.
Currently the following related methods and attributes are documented:
* addinfourl.getcode() == HTTPResponse.status
Martin Panter added the comment:
Blessing a geturl() method or “url” attribute on HTTPError might require Issue
13567 to be fixed
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue12707
Martin Panter added the comment:
Sorry my comment was a bit rushed. I wasn’t saying this feature shouldn’t be
added. I guess I was pointing out two things:
1. Someone should updated the documentation to say that Content-Length no
longer has to be explicitly provided for lists and tuples.
2
Martin Panter added the comment:
Nikolaus, do you still plan on doing the bzip module? If not, I could have a go
when I get a chance. I’m also keen for the GzipFile decompression to be fixed,
if anyone wants to review my gzip-bomb.patch
Martin Panter added the comment:
I looked at all the instances of __ne__() identified in the patch, and they all
seem redundant with the __eq__() implementations, so I think this patch is good.
--
___
Python tracker rep...@bugs.python.org
http
Martin Panter added the comment:
Updated v2 patch. This version avoids intruding into the
HTTPConnection.connect() implementation, so that users, tests, etc may still
set the undocumented “sock” attribute without calling the base connect()
method. Also code style changes based on feedback
Martin Panter added the comment:
I am certainly no expert, but this is how I understand the three different
kinds of codecs are used:
* Stateless codecs: str.encode(), bytes.decode(), etc
* Incremental codecs: TextIOWrapper, IncrementalNewlineDecoder
* Stream codecs: only stuff inside
Changes by Martin Panter vadmium...@gmail.com:
--
nosy: +vadmium
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17088
___
___
Python-bugs-list
Martin Panter added the comment:
Here is a new patch which fixes the bytes-to-bytes incremental codecs. It
depends on my patches for these other issues being applied first:
* Issue 23231: Bytes-to-bytes support for iteren/decode()
* Issue 13881: Generic StreamWriter from IncrementalEncoder
Martin Panter added the comment:
I’m happy with the new wording in v5. Maybe the docstring in the C module could
be reflowed though.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue21279
401 - 500 of 4209 matches
Mail list logo