[issue16134] Add support for RTMP schemes to urlparse

2013-11-23 Thread Martin Panter
Martin Panter added the comment: Looks like Issue 9374 already covers most of this, with fixes in 2.7, 3.2 and 3.3. $ python3.3 Python 3.3.2 (default, May 16 2013, 23:40:52) [GCC 4.6.3] on linux Type "help", "copyright", "credits" or "license" for

[issue15009] urlsplit can't round-trip relative-host urls.

2013-11-23 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue15009> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19622] Default buffering for input and output pipes in subprocess module

2013-11-25 Thread Martin Panter
Martin Panter added the comment: The updated text to “suprocess.rst” is better, but now it looks like the whole paragraph fails to render at http://docs.python.org/dev/library/subprocess#subprocess.Popen. I have no idea about the syntax but maybe the blank line separating “versionchanged

[issue19758] Warnings in tests

2013-11-25 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue19758> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17488] subprocess.Popen bufsize=0 parameter behaves differently in Python 3 than in 2

2013-11-26 Thread Martin Panter
Martin Panter added the comment: For the record, this issue seemed to forget about the effect of buffering the pipe to the subprocess’s input stream. Buffering an input pipe means that data is hidden away until it is flushed, and the close() method can raise a broken pipe error. I have

[issue17232] Improve -O docs

2013-11-27 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue17232> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19737] Documentation of globals() and locals() should be improved

2013-11-29 Thread Martin Panter
Martin Panter added the comment: How about swapping the two sentences for globals() then: “Returns the dictionary of the module . . . This represents the symbol table . . .” I thought the current locals() entry is fairly clear. It actually says _not_ to modify the dictionary

[issue18879] tempfile.NamedTemporaryFile can close the file too early, if not assigning to a variable

2013-11-29 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue18879> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19882] Closing a socket when makefile() is used

2013-12-03 Thread Martin Panter
New submission from Martin Panter: I think the documentation is rather vague about closing the underlying OS socket. Can someone verify if the following is true (*asterisked* bits are my additions), and maybe update the documentation? socket.close(): Close the socket *object*. *The underlying

[issue11563] test_urllibnet is triggering a ResourceWarning

2013-12-03 Thread Martin Panter
Martin Panter added the comment: I think the fix for this bug only works if it gets the server to respond with a “Connection: close” header itself. I opened Issue 19524 because I was seeing keep-alive responses using chunked encoding that still trigger a socket leak. -- nosy: +vadmium

[issue13797] Allow objects implemented in pure Python to export PEP 3118 buffers

2013-12-04 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue13797> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19524] ResourceWarning when urlopen() forgets the HTTPConnection object

2013-12-06 Thread Martin Panter
Martin Panter added the comment: Here are two patches: a test case, and a fix for my issue. They were done against an installed version of Python 3.3.3. I’m not entirely happy with the fix because it is accessing the private HTTPConnection.sock attribute from the urllib.request module, which

[issue19524] ResourceWarning when urlopen() forgets the HTTPConnection object

2013-12-06 Thread Martin Panter
Changes by Martin Panter : Added file: http://bugs.python.org/file33005/urlopen-sock-close.diff ___ Python tracker <http://bugs.python.org/issue19524> ___ ___ Python-bug

[issue18144] FD leak in urllib2

2013-12-06 Thread Martin Panter
Martin Panter added the comment: Confirmed that this happens when the server sends a chunked response, or sends a Content-Length header, but not when the server just sends “Connection: close”. So this looks like the same as Issue 19524, and my patch for that seems to fix the issue here

[issue19842] selectors: refactor BaseSelector implementation

2013-12-06 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue19842> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13736] urllib.request.urlopen leaks exceptions from socket and httplib.client

2013-12-07 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue13736> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue6631] Disallow relative files paths in urllib*.open()

2014-07-12 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue6631> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21970] Broken code for handling file://host in urllib.request.FileHandler.file_open

2014-07-12 Thread Martin Panter
New submission from Martin Panter: This isn’t a particularly important problem for me but when reading the code I noticed some bit rot in this function, where a host name in a “file:” URL would be handled differently than intended. * The url[:2] == '//' check is probably wrong bec

[issue21793] httplib client/server status refactor

2014-07-15 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue21793> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19524] ResourceWarning when urlopen() forgets the HTTPConnection object

2014-07-16 Thread Martin Panter
Changes by Martin Panter : Added file: http://bugs.python.org/file35980/test2.patch ___ Python tracker <http://bugs.python.org/issue19524> ___ ___ Python-bugs-list mailin

[issue19524] ResourceWarning when urlopen() forgets the HTTPConnection object

2014-07-16 Thread Martin Panter
Martin Panter added the comment: Added a new test for the invalid response case. Now both tests are included in test2.patch. I separated the actual fix into a separate close3.4.patch (refreshed for the 3.4 branch). This way it is easier for me to make sure the tests work before applying the

[issue14285] Traceback wrong on ImportError while executing a package

2014-07-17 Thread Martin Panter
Martin Panter added the comment: A file called “package/__main__.py” is executed as a script by “python -m package”. See <https://docs.python.org/dev/library/__main__.html>. I’ve came across this issue myself. You don’t even need the __main__.py file to be doing anything special, as l

[issue21996] gettarinfo method does not handle files without text string names

2014-07-17 Thread Martin Panter
New submission from Martin Panter: It looks like if you pass a “fileobj” argument to “gettarinfo”, it assumes it can use the “name” as a text string. >>> import tarfile >>> with tarfile.open("/dev/null", "w") as tar, open("/bin/sh",

[issue21044] tarfile does not handle file .name being an int

2014-07-17 Thread Martin Panter
Martin Panter added the comment: Opened Issue 21996 for the “gettarinfo” method. Also, Serhiy, I think you may have got me mixed up with someone else. I don’t think I did any patches here, so I probably shouldn’t be credited for them

[issue1927] raw_input behavior incorrect if readline not enabled

2014-07-19 Thread Martin Panter
Martin Panter added the comment: I experimented with various redirections to /dev/null, files, and other terminal windows on Linux. Current behaviour I am seeing seems to be something like this: * Prefers prompting to stderr if both stdout and stderr are terminals * Prefers prompting to

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-07-19 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue1152248> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17131] subprocess.Popen.terminate can raise exception on Posix

2014-07-19 Thread Martin Panter
Martin Panter added the comment: For Posix (dunno about Windows), calling terminate or kill at the OS level after a poll or wait has already succeeded is a bad idea, because the PID may have been recycled. It is essentially operating on a released resource, similar to calling “os.close” on a

[issue22021] shutil.make_archive() root_dir do not work

2014-07-21 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22021> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1025395] email.Utils.parseaddr fails to parse valid addresses

2014-07-25 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue1025395> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11429] ctypes is highly eclectic in its raw-memory support

2014-07-30 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue11429> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15986] memoryview: expose 'buf' attribute

2014-07-31 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue15986> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15986] memoryview: expose 'buf' attribute

2014-07-31 Thread Martin Panter
Martin Panter added the comment: This issue was linked from <https://mail.python.org/pipermail/python-dev/2012-September/121781.html>. I was looking for ways to pass read-only memory views into “ctypes” without copying memory, and came across that thread. Assuming this “buf” attribute

[issue11427] ctypes from_buffer no longer accepts bytes

2014-07-31 Thread Martin Panter
Martin Panter added the comment: For the record, I have been (ab?)using the “c_char_p” type to get the address of immutable byte strings without copying memory: >>> from ctypes import * >>> data = b"123\x00abc" >>> pubyte = cast(c_char_p(data), POIN

[issue11429] ctypes is highly eclectic in its raw-memory support

2014-07-31 Thread Martin Panter
Martin Panter added the comment: Interesting that “cast” accepts a byte string. If this is intended behaviour, it would be good to document that. Currently it says it takes “an object that can be interpreted as a pointer”. -- ___ Python tracker

[issue6259] ctypes pointer arithmetic

2014-07-31 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue6259> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10803] ctypes: better support of bytearray objects

2014-07-31 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue10803> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19023] ctypes docs: Unimplemented and undocumented features

2014-07-31 Thread Martin Panter
Martin Panter added the comment: Here is the patch stripped of all the noise and the structure and union stuff, so you can see just the changes related to arrays and pointers. However I have not attempted to apply the patch, nor addressed Georg’s comment about the “contents” attribute

[issue22123] Provide a direct function for types.SimpleNamespace()

2014-08-03 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22123> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1186900] nntplib shouldn't raise generic EOFError

2014-08-03 Thread Martin Panter
Martin Panter added the comment: I could be wrong, but isn’t this error raised when expecting a response from any command, not just during “connection establishment”? Perhaps change the docstring to say something like “Connection closed unexpectedly” instead. -- nosy: +vadmium

[issue19645] decouple unittest assertions from the TestCase class

2014-08-05 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue19645> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14534] Add method to mark unittest.TestCases as "do not run".

2014-08-05 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue14534> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue11664] Add patch method to unittest.TestCase

2014-08-05 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue11664> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22153] There is no standard TestCase.runTest implementation

2014-08-05 Thread Martin Panter
New submission from Martin Panter: The documentation for "unittest.TestCase" says "the standard implementation of the default 'methodName', runTest(), will run every method starting with 'test' as an individual test". However: >>> from unitte

[issue22155] Out of date code example for tkinter's createfilehandle

2014-08-06 Thread Martin Panter
New submission from Martin Panter: The only documentation on “createfilehandle” and friends that I can find looks like it needs updating: https://docs.python.org/release/3.4.0/faq/gui.html#can-i-have-tk-events-handled-while-waiting-for-i-o I have been using the equivalent of this instead, for

[issue22155] Out of date code example for tkinter's createfilehandler

2014-08-06 Thread Martin Panter
Changes by Martin Panter : -- title: Out of date code example for tkinter's createfilehandle -> Out of date code example for tkinter's createfilehandler ___ Python tracker <http://bugs.pytho

[issue3638] Remove module level functions in _tkinter that depend on TkappObject

2014-08-06 Thread Martin Panter
Martin Panter added the comment: See Issue 22155 for fixing the createfilehandler FAQ documentation -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue3

[issue22155] Out of date code example for tkinter's createfilehandler

2014-08-08 Thread Martin Panter
Martin Panter added the comment: Just about the broken docs link: I was trying to find a permanent version of the docs to link to. The usual docs page links to “Old versions” <https://www.python.org/doc/versions/>, but top link there, 3.4.1, does not seem to be ava

[issue22165] Empty response from http.server when directory listing contains invalid unicode

2014-08-08 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22165> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17131] subprocess.Popen.terminate can raise exception on Posix

2014-08-17 Thread Martin Panter
Martin Panter added the comment: This is more or less a dupe of Issue 6973, which also has a potential patch. -- ___ Python tracker <http://bugs.python.org/issue17

[issue6973] subprocess.Popen.send_signal doesn't check whether the process has terminated

2014-08-17 Thread Martin Panter
Martin Panter added the comment: It seems to me that raising OSError isn’t quite right. Either the error is more of an internal programmer error, like how writing to a closed file object raises ValueError, or there should not be an error, like when the process has terminated but has not been

[issue6973] subprocess.Popen.send_signal doesn't check whether the process has terminated

2014-08-17 Thread Martin Panter
Changes by Martin Panter : -- components: +Library (Lib) -Interpreter Core ___ Python tracker <http://bugs.python.org/issue6973> ___ ___ Python-bugs-list mailin

[issue18554] os.__all__ is incomplete

2014-08-18 Thread Martin Panter
Martin Panter added the comment: I ran into this today, trying to do “help(os)”. The workaround was to do “import posix; help(posix)”. -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue18

[issue22234] urllib.parse.urlparse accepts any falsy value as an url

2014-08-21 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22234> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22239] asyncio: nested event loop

2014-08-21 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22239> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22237] sorted() docs should state that the sort is stable

2014-08-21 Thread Martin Panter
Martin Panter added the comment: It looks like a fork of that how-to is actually part of the documentation: <https://docs.python.org/release/3.4.0/howto/sorting.html>. Perhaps the two should be linked better. If “sorted” is indeed meant to be stable, that makes the docstring f

[issue1186900] nntplib shouldn't raise generic EOFError

2014-08-21 Thread Martin Panter
Martin Panter added the comment: NNTPConnectError does still seem a slightly awkward name. I would go for NNTPConnectionError instead, but I’m also happy to put my bikeshed paint away let this patch be applied as is :) Handling of NNTPTemporaryError with a code of 400 is similar to handling

[issue22247] More incomplete module.__all__ lists

2014-08-21 Thread Martin Panter
New submission from Martin Panter: The nntplib.NNTPError exception is documented, but missing from __all__. I ran across another one the other day, but I can’t remember what it was now. Is there a practical way to automatically test for some of these, perhaps by scanning the documentation for

[issue1186900] nntplib shouldn't raise generic EOFError

2014-08-21 Thread Martin Panter
Martin Panter added the comment: Some more points: * I suggest adding something like this to the documentation: exception nntplib.NNTPConnect[ion]Error Exception raised when the server unexpectedly shuts down the connection. * The tests should use BytesIO rather than StringIO. Other than

[issue1186900] nntplib shouldn't raise generic EOFError

2014-08-21 Thread Martin Panter
Martin Panter added the comment: PPS: Documentation should probably have the “New in version 3.5” tag as well -- ___ Python tracker <http://bugs.python.org/issue1186

[issue12855] linebreak sequences should be better documented

2014-08-26 Thread Martin Panter
Martin Panter added the comment: Any reason why characters 1C–1E are excluded? -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue12855> ___ ___

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-08-26 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue12067> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21611] int() docstring - unclear what number is

2014-08-27 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue21611> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12319] [http.client] HTTPConnection.putrequest not support "chunked" Transfer-Encodings to send data

2014-08-29 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue12319> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue12707] Deprecate addinfourl getters

2014-08-31 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue12707> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue4733] Add a "decode to declared encoding" version of urlopen to urllib

2014-08-31 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue4733> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1508475] transparent gzip compression in urllib

2014-09-01 Thread Martin Panter
Martin Panter added the comment: I think the patch is indeed a bit short, for instannce it looks like calling read() without a size limit could bypass the decoding. Also, I wonder if Content-Encoding handling is better done at a higher level. What if someone wants to download a *.tar.gz file

[issue22253] ConfigParser does not handle files without sections

2014-09-04 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22253> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17083] can't specify newline string for readline for binary files

2014-09-04 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue17083> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1152248] Add support for reading records with arbitrary separators to the standard IO stack

2014-09-04 Thread Martin Panter
Martin Panter added the comment: Related: * Issue 563491: 2002 proposal for parameter to readline, rejected at the time * Issue 17083: Newline is hard coded for binary file readline Fixing this issue for binary files would probably also satisfy Issue 17083

[issue1243678] httplib gzip support

2014-09-04 Thread Martin Panter
Martin Panter added the comment: Agreed, this issue is not a duplicate of the marked “gzip” seek issue, however it _does_ duplicate Issue 1508475. -- ___ Python tracker <http://bugs.python.org/issue1243

[issue1508475] transparent gzip compression in urllib

2014-09-04 Thread Martin Panter
Martin Panter added the comment: Related: Issue 1243678, which includes a patch for “httplib” (now known as “http.client”?). That patch looks like it sets Accept-Encoding and decodes according to Content-Encoding. However I suspect it is also trying to be too “transparent” at the wrong level

[issue21228] Missing enumeration of HTTPResponse Objects methods of urllib.request.urlopen's http.client.HTTPResponse?

2014-09-04 Thread Martin Panter
Martin Panter added the comment: With this patch, there is no longer any implication that the returned object implements the “addinfourl” interface. Perhaps that should be added back. Or maybe add it to the HTTPResponse class documentation itself? There is a comment that says the methods are

[issue22341] Python 3 crc32 documentation clarifications

2014-09-05 Thread Martin Panter
New submission from Martin Panter: This is regarding the Python 3 documentation for binascii.crc32(), <https://docs.python.org/dev/library/binascii.html#binascii.crc32>. It repeatedly recommends correcting the sign by doing crc32() & 0x, but it is not immediately clear why.

[issue19280] Add a datatype to represent mime types to the email module

2014-09-05 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue19280> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1043134] Add preferred extensions for MIME types

2014-09-05 Thread Martin Panter
Martin Panter added the comment: See also <https://bugs.python.org/issue6626#msg91205>, which mentions using a list of tuples instead of a dictionary, which sounds like it might help with this issue. Doing it that way you might be able avoid some duplication in the lists. -

[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2014-09-05 Thread Martin Panter
New submission from Martin Panter: The documentation says that guess_type() takes a URL, but: >>> mimetypes.guess_type("http://example.com";) ('application/x-msdownload', None) I suspect the MS download is a reference to *.com files (like DOS's command.com).

[issue12067] Doc: remove errors about mixed-type comparisons.

2014-09-06 Thread Martin Panter
Martin Panter added the comment: The point about “a != b” deferring to “not a.__eq__(b)” is not documented anywhere that I am aware of. In fact the opposite is currently documented at <https://docs.python.org/release/3.4.0/reference/datamodel.html#richcmpfuncs>, so maybe this needs

[issue22350] nntplib file write failure causes exception from QUIT command

2014-09-06 Thread Martin Panter
New submission from Martin Panter: The following code triggers an NNTPProtocolError, as long as the body is large enough to cause an intermediate flush of the output file. The reason I think is that the body() method aborts in the middle of reading the BODY response, and when the context

[issue21468] NNTPLib connections become corrupt after long periods of activity

2014-09-06 Thread Martin Panter
Martin Panter added the comment: Perhaps this is similar to Issue 22350 which I just raised. Whenever the NNTP context manager exits, a QUIT command is called, and if the context manager is exiting due to a protocol error or some other exception not handled by the protocol, the code will try

[issue22351] NNTP constructor exception leaves socket for garbage collector

2014-09-06 Thread Martin Panter
New submission from Martin Panter: If the nntplib.NNTP constructor fails, it often leaves the connection and socket open until the garbage collector cleans them up and emits a ResourceWarning: >>> try: ... NNTP("localhost") ... except Exception as err: ...

[issue20132] Many incremental codecs don’t handle fragmented data

2014-09-09 Thread Martin Panter
Martin Panter added the comment: Stream reader interfaces suffer the same problem. Test cases: codecs.getreader("unicode-escape")(BytesIO(br"\u2013")).read(1) codecs.getreader("hex-codec")(BytesIO(b"33")).read(1) codecs.getreader("base64-codec"

[issue13881] Stream encoder for zlib_codec doesn't use the incremental encoder

2014-09-09 Thread Martin Panter
Martin Panter added the comment: The corresponding stream reader has a related issue which I mentioned in Issue 20132 -- ___ Python tracker <http://bugs.python.org/issue13

[issue13881] Stream encoder for zlib_codec doesn't use the incremental encoder

2014-09-09 Thread Martin Panter
Martin Panter added the comment: Even if all these issues aren’t worth fixing, I think the documentation should at least say which codecs work fully (e.g. most text encodings), which ones work suboptimally (e.g. UTF-7), and which ones only work for single-shot encoding and decoding

[issue20506] Command to display all available Import Library

2014-09-09 Thread Martin Panter
Martin Panter added the comment: I wrote some code that does something like this for a hacky custom readline completer. See the import_list() method at <https://github.com/vadmium/etc/blob/6ac333f/python/pythonstartup.py#L222>. It looks like I’m using a combinat

[issue15955] gzip, bz2, lzma: add option to limit output size

2014-09-10 Thread Martin Panter
Martin Panter added the comment: If people are worried about the best low-level decompressor API, maybe leave that as a future enhancement, and just rely on using the existing file reader APIs. I would expect them to have a sensible decompressed buffer size limit, however “bzip2” and LZMA

[issue22374] Replace contextmanager example and improve explanation

2014-09-10 Thread Martin Panter
Martin Panter added the comment: You should probably use try / finally in your context manager to always restore the attribute. Having said that, I recently wrote a similar context manager, and then later discovered there is already “unittest.mock.patch” and/or “unittest.mock.patch.object

[issue16830] Add skip_host and skip_accept_encoding to httplib/http.client

2014-09-10 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue16830> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue21228] Missing enumeration of HTTPResponse Objects methods of urllib.request.urlopen's http.client.HTTPResponse?

2014-09-10 Thread Martin Panter
Martin Panter added the comment: By removing the “addinfourl” methods for HTTP responses, you are making it unnecessarily hard to handle header fields and metadata from the response. I do not know of any other documented way of getting the eventual redirect target, other than geturl(). And

[issue21228] Missing enumeration of HTTPResponse Objects methods of urllib.request.urlopen's http.client.HTTPResponse?

2014-09-11 Thread Martin Panter
Martin Panter added the comment: Fair enough, challenge accepted! Here is my attempt. I have explicitly made the info(), geturl() and getcode() methods available for all cases, and used Evens’s wording for the modified “msg” attribute, but dropped mentioning the “url” attribute

[issue12916] Add inspect.splitdoc

2014-09-13 Thread Martin Panter
Martin Panter added the comment: Although it is not documented, inspect.getdoc() may return None instead of a documentation string. In patch 2, inspect.splitdoc() only accepts a string; perhaps it should also accept None? Otherwise you might have to use it like this: [summary, body

[issue22406] uu-codec trailing garbage workaround is Python 2 code

2014-09-14 Thread Martin Panter
New submission from Martin Panter: The handler for the “Trailing garbage” error for “uu-codec” uses Python 2 code, while the copy in the "uu” module has the correct Python 3 code. Please change the line at https://hg.python.org/cpython/file/775453a7b85d/Lib/encodings/uu_codec.py#l57 to

[issue22413] Bizarre StringIO(newline="\r\n") translation

2014-09-14 Thread Martin Panter
New submission from Martin Panter: I noticed that the newline translation in the io.StringIO class does not behave as I would expect: >>> text = "NL\n" "CRLF\r\n" "CR\r" "EOF" >>> s = StringIO(text, newline="\r\n") >>

[issue15216] Support setting the encoding on a text stream after creation

2014-09-14 Thread Martin Panter
Martin Panter added the comment: Some more use cases for temporarily switching error handler in the middle of writing to a stream: * Possibly simplify the implementation of sys.displayhook() * I have done a similar hack at <https://bitbucket.org/Gfy/pyrescene/comm

[issue22406] uu-codec trailing garbage workaround is Python 2 code

2014-09-14 Thread Martin Panter
Changes by Martin Panter : Added file: http://bugs.python.org/file36619/uu_codec ___ Python tracker <http://bugs.python.org/issue22406> ___ ___ Python-bugs-list mailin

[issue22406] uu-codec trailing garbage workaround is Python 2 code

2014-09-14 Thread Martin Panter
Martin Panter added the comment: Here are two patches: a test and a fix. I’m not sure if it is okay to add a test for the “codecs” module with the tests for the “uu” module; it was easier that way because I am basically running the same test over the two different APIs. -- Added file

[issue22431] Change format of test runner output

2014-09-17 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22431> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue22435] socketserver.TCPSocket leaks socket to garbage collector if server_bind() fails

2014-09-17 Thread Martin Panter
New submission from Martin Panter: Bind method may easily fail on Unix if there is no permission to bind to a privileged port: >>> try: TCPServer(("", 80), ...) ... except Exception as err: err ... PermissionError(13, 'Permission denied') >>> gc.collect()

[issue21049] Warning at interpreter exit triggers flood of “ImportWarning: sys.meta_path is empty”

2014-09-17 Thread Martin Panter
Martin Panter added the comment: My original demonstration was distilled from a real world case. I get this issue with other real world cases too, so I am expanding the title to reflect what I think is going on. This problem seems to be caused by a ResourceWarning triggered from a garbage

[issue4887] environment inspection and manipulation API is buggy, inconsistent with "Python philosophy" for wrapping native APIs

2014-09-21 Thread Martin Panter
Martin Panter added the comment: I suspect the $PATH example is a bad example. On my Linux setup, my initial PATH value is a customized path. After popping it and calling system(), I see a simpler default path, which is probably re-initialized somewhere else. I suspect there is no environ.pop

[issue1159] os.getenv() not updated after external module uses C putenv()

2014-09-21 Thread Martin Panter
Changes by Martin Panter : -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue1159> ___ ___ Python-bugs-list mailing list Unsubscribe:

<    2   3   4   5   6   7   8   9   10   11   >