[issue27787] Avoid test_main() in test_httplib; gc.collect() dangling threads

2016-08-23 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue27643] test_ctypes fails on AIX with xlc

2016-08-23 Thread Martin Panter
Martin Panter added the comment: Michael: When posting to the bug tracker, please trim irrelevant parts of old messages. It makes it hard to see if you actually added anything new. > [Me] If your compiler does not support “signed short” bitfields, maybe we > just have to accept that

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

2016-08-24 Thread Martin Panter
Martin Panter added the comment: Rolf, just a note that I had to remove some trailing spaces on various continued lines in the Python code before it would let me push this. Other tweaks I made: * Eliminate _read_iterable() and lambda * Rename line → chunk The Windows buildbots fail the test

[issue21826] Performance issue (+fix) AIX ctypes.util with no /sbin/ldconfig present

2016-08-24 Thread Martin Panter
Martin Panter added the comment: For the record, if you wanted to actually load the library function on AIX, I understand the code might look a bit like: if sys.platform.startswith("aix"): if sys.maxsize > 2**32: lib = "libc.a(shr_64.o)" else:

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

2016-08-24 Thread Martin Panter
Martin Panter added the comment: Thankyou Eryksun for the detailed explanation. Unfortunately, that means that uploading an unseekable file via urllib.request, or via http.client, isn’t going to work by default on Windows. I see a couple of workarounds with the current code: * Users can

[issue18485] mingw: configure for shared build

2016-08-24 Thread Martin Panter
Martin Panter added the comment: Roumen’s patch amends code added by his patches at Issue 17597. Here is a version which is independent. -- nosy: +martin.panter stage: -> patch review versions: +Python 3.6 -Python 3.4 Added file: http://bugs.python.org/file44210/mingw-shared.v2.pa

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

2016-08-24 Thread Martin Panter
Martin Panter added the comment: Here is my attempt to drop automatic Content-Length with files. I also dropped the special handling of zero-length iterables, added some tests for that, and removed some unused and misleading bits from other tests. -- Added file: https

[issue19884] Importing readline produces erroneous output

2016-08-25 Thread Martin Panter
Martin Panter added the comment: Thanks, I can try to commit the version fix part of the patch when I get a chance. What is EL6.8, is that a Red Hat (Enterprise Linux) thing? -- versions: +Python 3.6 -Python 3.4 ___ Python tracker <ht

[issue27805] io.open('/dev/stdout', 'a') raises OSError with errno=ESPIPE

2016-08-26 Thread Martin Panter
Changes by Martin Panter : -- title: os.open('/dev/stdout', 'a') raises OSError with errno=ESPIPE -> io.open('/dev/stdout', 'a') raises OSError with errno=ESPIPE ___ Python t

[issue27830] Add _PyObject_FastCallKeywords(): avoid the creation of a temporary dictionary for keyword arguments

2016-08-26 Thread Martin Panter
Martin Panter added the comment: FYI revision ffcfa4f005a3 removed the code that uses your new _PyStack_AsDict() function, so now there is a compiler warning: Objects/abstract.c:2313:1: warning: ‘_PyStack_AsDict’ defined but not used [-Wunused-function] _PyStack_AsDict(PyObject **stack

[issue26027] Support Path objects in the posix module

2016-08-26 Thread Martin Panter
Martin Panter added the comment: This change causes test_os to produce warnings, and can fail: $ hg update b64f83d6ff24 $ ./python -bWerror -m test -u all -W test_os [. . .] == ERROR: test_path_t_converter

[issue26638] Avoid warnings about missing CLI options when building documentation

2016-08-26 Thread Martin Panter
Martin Panter added the comment: Terry: the four "ini" syntax highlighting warnings were also mentioned in <https://bugs.python.org/issue26462#msg271241>. In that bug, we fixed many other similar warnings, but I think we left those as being less easy to fix. One t

[issue27425] Tests fail because of git's newline preferences on Windows

2016-08-26 Thread Martin Panter
Martin Panter added the comment: Emanuel: fix_newlines_2.patch seems to change the contents of batch from CRLF to LF newlines, undoing revision 640ccb924b5f. This seems like a step in the wrong direction. Notice $ means LF, and ^M$ means CRLF: $ curl https://bugs.python.org/file44225

[issue26027] Support Path objects in the posix module

2016-08-26 Thread Martin Panter
Martin Panter added the comment: One more thing, ;) the Windows buildbots are failing to removing a temporary file: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/8173/steps/test/logs/stdio

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

2016-08-26 Thread Martin Panter
Martin Panter added the comment: I committed my patch, so now file bodies are chunk-encoded by default. The Windows buildbots pass the relevant tests again. This does mean that old code that uploaded a file to a HTTP-1.0-only server, and relied on Python automatically setting Content-Length

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-08-26 Thread Martin Panter
Changes by Martin Panter : Added file: https://bugs.python.org/file44237/Python3.6.ctypes.160823.patch ___ Python tracker <https://bugs.python.org/issue26439> ___ ___

[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-08-27 Thread Martin Panter
Martin Panter added the comment: The documentation is in RST format in the Doc/ directory. For basic stuff, you can just copy the syntax from existing text, or see e.g. <https://docs.python.org/devguide/documenting.html#restructuredtext-primer> for more hints. For this change, I think w

[issue19884] Importing readline produces erroneous output

2016-08-27 Thread Martin Panter
Martin Panter added the comment: I committed my patch in full, so hopefully the Gnu Readline situation on OS X is also improved. Original fixes went into 3.4, but my patch only went into 3.5+. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed

[issue25825] AIX shared library extension modules installation broken

2016-08-27 Thread Martin Panter
Martin Panter added the comment: Okay, the second patch is committed to 3.5+. Is everything working now (on 2.7, 3.5, 3.6), or is there more to do? -- ___ Python tracker <https://bugs.python.org/issue25

[issue27506] make bytes/bytearray translate's delete a keyword argument

2016-08-27 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue24045] Behavior of large returncodes (sys.exit(nn))

2016-08-28 Thread Martin Panter
Martin Panter added the comment: Is this a duplicate of Issue 24052? -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue24045> ___ ___ Pytho

[issue24052] sys.exit(code) returns "success" to the OS for some nonzero values of code

2016-08-28 Thread Martin Panter
Martin Panter added the comment: Here is a relevant Posix bug thread: http://austingroupbugs.net/view.php?id=947 As well as Windows, apparently Solaris, OS X, and a recent version of Free BSD have more than eight bits of exit status. I don’t know if Python’s sys.exit() supports this though

[issue27893] email.parser.BytesParser.parsebytes docs fix

2016-08-30 Thread Martin Panter
New submission from Martin Panter: Actually it seems the parameter is called *text*: >>> BytesParser().parsebytes(bytes=b"") TypeError: parsebytes() got an unexpected keyword argument 'bytes' >>> BytesParser().parsebytes(text=b"") -

[issue22450] urllib doesn't put Accept: */* in the headers

2016-08-30 Thread Martin Panter
Martin Panter added the comment: “Proxy servers such as NGinx and Varnish: . . . if the Accept header is omitted, the proxy cache can return any of the cached responses.” This is not really my area of expertise, but this behaviour is inconsistent with my understanding of how Accept and Vary

[issue22233] http.client splits headers on non-\r\n characters

2016-08-30 Thread Martin Panter
Martin Panter added the comment: If someone reviews my patch and thinks it is fine, I might commit it. Maybe I can just re-review it myself, now that I have forgotten all the details :) If messing with the email package is a problem (performance, or compatibility), another option is to keep

[issue27895] Spelling fixes

2016-08-30 Thread Martin Panter
Martin Panter added the comment: Be careful with user-visible changes to the code, like the _encoded_EMTPY attribute (Issue 27630). I wouldn’t backport that. -- nosy: +martin.panter versions: +Python 3.6 ___ Python tracker <http://bugs.python.

[issue27630] Generator._encoded_EMTPY misspelling in email package

2016-08-30 Thread Martin Panter
Martin Panter added the comment: FYI in 3.6 the spelling has been changed to _EMPTY (Issue 27895) -- ___ Python tracker <http://bugs.python.org/issue27

[issue9951] introduce bytes.hex method

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

[issue22587] os.path.abspath(None) behavior is inconsistent between platforms

2014-10-10 Thread Martin Panter
Martin Panter added the comment: I always assumed that None was a unwise value to pass to the “os.path” functions. Indeed, at the top of the documentation page it says they only accept bytes or (text) string parameters. Although returning a consistent error might be a sensible addition

[issue22601] asyncio: loop.run_forever() should consume exception of the temporary task

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

[issue22599] traceback: errors in the linecache module at exit

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

[issue19421] FileIO destructor imports indirectly the io module at exit

2014-10-10 Thread Martin Panter
Martin Panter added the comment: For the record, the python-dev thread about blocking imports is at <https://mail.python.org/pipermail/python-dev/2013-October/129907.html>. It sounded like the conclusion was that there shouldn’t be a problem importing a module at finalization.

[issue11664] Add patch method to unittest.TestCase

2014-10-12 Thread Martin Panter
Martin Panter added the comment: [padding to avoid UTF-8 error with bug tracker] See also Issue 22374, where an equivalent of “patch.object” is suggested as an example context manager for the “contextlib” documentation. If we added a plain function or context manager rather than a new

[issue22001] containers "same" does not always mean "__eq__".

2014-10-12 Thread Martin Panter
Martin Panter added the comment: Issue 12067 has a large patch in progress that would conflict with the changes suggested here. However most of the concerns here may already be addressed there, if the patch ever goes ahead. -- nosy: +vadmium

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

2014-10-12 Thread Martin Panter
Martin Panter added the comment: Maybe it would be wise to split this task up and commit the bits that don’t need any more work. I think the existing patch might already solve Issue 22001. -- ___ Python tracker <http://bugs.python.org/issue12

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

2014-10-13 Thread Martin Panter
Martin Panter added the comment: About the byte sequence comparisons, I wondered if it was misleading to say that a list(), tuple() or range() can only be compared to the same type, without mentioning that bytes() and bytearray() can be compared to each other. BTW just noticed you say range

[issue15944] memoryviews and ctypes

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

[issue21436] Consider leaving importlib.abc.Loader.load_module()

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

[issue22665] shutil.__all__ incomplete

2014-10-17 Thread Martin Panter
New submission from Martin Panter: Continuing on from Issue 22247 (other out-of-date __all__ attributes), shutil.__all__ is missing (at least) get_terminal_size(), which was implemented for Issue 13609. -- components: Library (Lib) messages: 229630 nosy: vadmium priority: normal

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

2014-10-18 Thread Martin Panter
Martin Panter added the comment: Is there anything else that needs doing to get this committed and resolved? My patch is just a trivial reordering of Evens’s, with about one sentence deleted. -- ___ Python tracker <http://bugs.python.org/issue21

[issue22665] shutil.__all__ incomplete

2014-10-24 Thread Martin Panter
Martin Panter added the comment: Looking at Lib/test/test___all__.py, that module just makes sure that the names imported with “from ... import *” are the same as listed in the __all__ attribute. It does no know what the __all__ attribute is meant to contain

[issue10390] json.load should handle bytes input

2014-10-24 Thread Martin Panter
Martin Panter added the comment: See also Issue 10976, discussing passing bytes() strings to json.loads() -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue10

[issue19837] Wire protocol encoding for the JSON module

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

[issue10976] json.loads() raises TypeError on bytes object

2014-10-24 Thread Martin Panter
Martin Panter added the comment: Issue 17909 (auto-detecting JSON encoding) looks like it has a patch which would probably satisfy this issue -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue10

[issue17909] Autodetecting JSON encoding

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

[issue22678] An OSError subclass for "no space left on device" would be nice

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

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

2014-10-26 Thread Martin Panter
Martin Panter added the comment: The new text seems reasonable to me on its own, however I still think the heapsort() docstring needs updating as well -- ___ Python tracker <http://bugs.python.org/issue22

[issue17909] Autodetecting JSON encoding

2014-10-26 Thread Martin Panter
Martin Panter added the comment: If you adjusted the detect_encoding() logic according to Pete Cordell’s table at the bottom of <http://www.ietf.org/mail-archive/web/json/current/msg01959.html>, it might work for standalone strings. However since the RFC encourages UTF-8 fo

[issue21650] add json.tool option to avoid alphabetic sort of fields

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

[issue22153] There is no standard TestCase.runTest implementation

2014-10-28 Thread Martin Panter
Martin Panter added the comment: The patch seems reasonable to me -- ___ Python tracker <http://bugs.python.org/issue22153> ___ ___ Python-bugs-list mailin

[issue22153] There is no standard TestCase.runTest implementation

2014-10-28 Thread Martin Panter
Martin Panter added the comment: Do you mean pretending there is no default “methodName” value, or pretending that the runTest() method is not invoked by discovery? I would have to check, but I think I have relied on the runTest() method being discovered in the past, when I did not think a

[issue18236] str.isspace should use the Unicode White_Space property

2014-10-28 Thread Martin Panter
Martin Panter added the comment: As uncovered in Issue 12855, str.splitlines() currently considers the FS, GS and RS (1C–1E), but not the US (1F), to be line breaks. It might be surprising if these are no longer considered white space but are still considered line breaks. -- nosy

[issue22755] contextlib.closing documentation should use a new example

2014-10-28 Thread Martin Panter
Martin Panter added the comment: One exception that comes to mind is generators. According to Issue 13814, it is deliberate that you have to call close(), so perhaps someone could come up with an example based on that. -- nosy: +vadmium ___ Python

[issue22153] There is no standard TestCase.runTest implementation

2014-10-28 Thread Martin Panter
Martin Panter added the comment: Removing stuff from the documentation would make it hard to understand what existing code means that uses runTest(). Isn’t this a case where you would add a big red “Deprecated since version . . .” warning instead? Maybe a comprimise would be to “hide” its

[issue22834] Unexpected FileNotFoundError when current directory is removed

2014-11-09 Thread Martin Panter
New submission from Martin Panter: I encountered this when I added a unit test case that invoked os.chdir() with a temporary directory on Linux. After the directory was removed, some of the subsequent test cases failed, although I don’t think they should depend on a particular CWD. I suspect

[issue22836] Broken "Exception ignored in:" message on exceptions in __repr__

2014-11-10 Thread Martin Panter
Martin Panter added the comment: This is one that has often bugged me. When your repr() implementation is broken, it is quite confusing figuring out what is going wrong. Falling back to object.__repr__() is one option, however I would probably be happy with a simple “exception in repr

[issue13444] closed stdout causes error on stderr when the interpreter unconditionally flushes on shutdown

2014-11-11 Thread Martin Panter
Martin Panter added the comment: Shouldn’t this issue be marked closed and fixed? -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue13444> ___ ___

[issue22852] urllib.parse wrongly strips empty #fragment

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

[issue22854] Documentation/implementation out of sync for IO

2014-11-12 Thread Martin Panter
Martin Panter added the comment: Similarly for the readable(), seekable() and writable() documentation -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22

[issue19777] Provide a home() classmethod on Path objects

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

[issue22834] Unexpected FileNotFoundError when current directory is removed

2014-11-14 Thread Martin Panter
Martin Panter added the comment: The only time I see a warning would be useful is if you intended to override a standard module with a module of the same name in the current directory. In all other cases I think it would be better to either generate an ImportError if the module is not found

[issue22867] document behavior of calling atexit.register() while atexit._run_exitfuncs is running

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

[issue7427] BadStatusLine is hell to debug

2014-11-19 Thread Martin Panter
Martin Panter added the comment: As far as I can tell, the “line” attribute isn’t documented anyway. But Issue 8450 is opened about improving the exception when the connection is closed. -- nosy: +vadmium ___ Python tracker <http://bugs.python.

[issue14044] IncompleteRead error with urllib2 or urllib.request -- fine with urllib, wget, or curl

2014-11-19 Thread Martin Panter
Martin Panter added the comment: I suggest this is the same situation as Issue 6785, and is not a bug in Python. However it might be reasonable to allow forcing a HTTP client connection to version 1.0, which could be used as a workaround

[issue8450] httplib: false BadStatusLine() raised

2014-11-19 Thread Martin Panter
Martin Panter added the comment: See also Issue 3566, which also brings up the false BadStatusLine exception, and suggests some kind of retry logic. Whatever exception it is, it could be documented better. In Issue 66621, the poster thought it should be an IncompleteRead exception

[issue8450] httplib: false BadStatusLine() raised

2014-11-19 Thread Martin Panter
Martin Panter added the comment: Sorry the IncompleteRead reference was meant to be Issue 666219 -- ___ Python tracker <http://bugs.python.org/issue8450> ___ ___

[issue3566] httplib persistent connections violate MUST in RFC2616 sec 8.1.4.

2014-11-19 Thread Martin Panter
Martin Panter added the comment: I don’t think the peek hack needs to go into to the standard library. It is just a workaround for code using the current library, to differentiate an empty status line due to EOF from any other kind of “bad” status line. This is what Issue 8450, “False

[issue21032] Socket leak if HTTPConnection.getresponse() fails

2014-12-01 Thread Martin Panter
Martin Panter added the comment: Hi Serhiy, I submitted the form online on 22 Nov; just patiently waiting for it to come through now. In the last few minutes I noticed an asterisk has appeared against my name on the bug tracker, so hopefully it is all good now

[issue22407] re.LOCALE is nonsensical for Unicode

2014-12-01 Thread Martin Panter
Martin Panter added the comment: Looks like revision 561d1d0de518 was to fix this issue, but the NEWS entry has the wrong reference number -- nosy: +vadmium ___ Python tracker <http://bugs.python.org/issue22

[issue22977] Unformatted “Windows Error 0x%X” exception message

2014-12-02 Thread Martin Panter
New submission from Martin Panter: The following code generates a connection reset error on Wine (Windows emulator, because I don’t have actual Windows to test on). Probably only a minor issue, but the error message isn’t quite right: >>> s = create_connection(("lo

[issue22989] HTTPResponse.msg not as documented

2014-12-05 Thread Martin Panter
Martin Panter added the comment: See Issue 21228 for a patch which documents the “.msg” hack, and that the info() method is available for HTTP responses. I think documenting the “.headers” attribute would be a bad idea, because it is introducing yet another way to do what the almost

[issue22153] Documentation of TestCase.runTest is incorrect and confusing

2014-12-05 Thread Martin Panter
Martin Panter added the comment: Updated patch with indentation fixed and new wording. I am just guessing the RST syntax based on the surrounding text, so please review :) -- Added file: http://bugs.python.org/file37372/runtest.patch ___ Python

[issue22153] Documentation of TestCase.runTest is incorrect and confusing

2014-12-06 Thread Martin Panter
Changes by Martin Panter : Added file: http://bugs.python.org/file37377/runTest2-3.4.patch ___ Python tracker <http://bugs.python.org/issue22153> ___ ___ Python-bug

[issue22153] Documentation of TestCase.runTest is incorrect and confusing

2014-12-06 Thread Martin Panter
Martin Panter added the comment: Updated patch, which applies to current tip of the default branch, and includes the formatting fix. Also including a version that applies to the 3.4 branch. Alternatively, if you patch the 3.4 branch it looks like merging to default automatically gives the

[issue18373] implement sys.get/setbyteswarningflag()

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

[issue18679] include a codec to handle escaping only control characters but not any others

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

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

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

[issue21279] str.translate documentation incomplete

2014-12-12 Thread Martin Panter
Martin Panter added the comment: Update patch with typo fixed, removed note about the “codecs” module (which I never found useful either), and updated the doc string with similar wording. Terry, do you think the wording in the patch is good enough, or do you think some of your proposed

[issue22875] asyncio: call_soon() documentation unclear on timing

2014-12-12 Thread Martin Panter
Martin Panter added the comment: I have been bitten by this when attempting to implement my own event loops. Parts of the “asyncio” code itself expects that the callback is not invoked directly after call_soon() returns. Here is a simple patch. -- keywords: +patch nosy: +vadmium

[issue23046] asyncio.BaseEventLoop is documented, but only exported via asyncio.base_events

2014-12-12 Thread Martin Panter
New submission from Martin Panter: The documentation mentions BaseEventLoop as an attribute of the “asyncio” module, but it is not actually there (at least in v3.4.2). I have to import it specially from “asyncio.base_events”. Is this an oversight in the documentation, or am I relying on

[issue21279] str.translate documentation incomplete

2014-12-15 Thread Martin Panter
Martin Panter added the comment: I’m largely happy with any of these revisions. If I end up doing another patch I would omit the *str* (it is a class name, not a parameter). Also I would omit the range(2^20) claim. Unless people think it is important; why is it different to sys.maxunicode + 1

[issue22928] HTTP header injection in urrlib2/urllib/httplib/http.client

2014-12-15 Thread Martin Panter
Martin Panter added the comment: There could be potential for breaking compatibility if people are intentionally sending values with folded lines (obsoleted by the new HTTP RFC). Perhaps the same error should be raised for values that cannot be encoded in Latin-1? Also, maybe most control

[issue23062] test_argparse --version test cases

2014-12-15 Thread Martin Panter
New submission from Martin Panter: In Lib/test/test_argparse.py: class TestHelpVersionOptional(HelpTestCase): """Test that the --version argument can be suppressed help messages""" Assuming that the docstring means something like “. . . can be suppressed _in

[issue9694] argparse required arguments displayed under "optional arguments"

2014-12-15 Thread Martin Panter
Martin Panter added the comment: Here is much larger patch in the spirit of Ryan’s, that fixes the documentation, adjusts the tests, and some of the internal comments and variable names in the source code as well. However if some changes are too controversial, I am happy to simplify it to

[issue21619] Cleaning up a subprocess with a broken pipe

2014-12-16 Thread Martin Panter
Martin Panter added the comment: Here is a patch to fix this by calling wait() even if stdin.close() fails, including a test case. With my patch, the subprocess context manager __exit__() will still raise a BrokenPipeError, but no zombie will be left. -- keywords: +patch Added file

[issue23054] ConnectionError: ('Connection aborted.', BadStatusLine(""''''"))

2014-12-16 Thread Martin Panter
Martin Panter added the comment: Not exactly sure what do you want the Python library to do, but perhaps this is a duplicate of Issue 8450, about making the error less misleading when the connection is closed before _any_ status line is sent. See also Issue 7427. -- nosy: +vadmium

[issue16349] Document whether it's safe to use bytes for struct format string

2014-12-16 Thread Martin Panter
Martin Panter added the comment: Actually the “struct” module doc string seems to already hint that format strings can be byte strings: “Python bytes objects are used to hold the data representing the C struct and also as format strings

[issue21071] struct.Struct.format is bytes, but should be str

2014-12-16 Thread Martin Panter
Martin Panter added the comment: It seems to me that the simplest fix is to document: 1. Struct.format attribute is a byte string 2. The input format strings for struct.pack(), Struct class, etc, are also allowed to be byte strings, for consistency (Issue 16349) Here is a patch that does that

[issue16776] Document PyCFunction_New and PyCFunction_NewEx functions

2014-12-16 Thread Martin Panter
Martin Panter added the comment: I’m far from an expert on the C API, but I was looking for a way to inspect a “builtin_function_or_method” a.k.a. PyCFunction_Type a.k.a. types.BuiltinMethodType, and ended up looking at the “Instance Method Objects” section. So maybe your functions should go

[issue19176] DeprecationWarning for doctype() method when subclassing _elementtree.XMLParser

2014-12-16 Thread Martin Panter
Martin Panter added the comment: Since the doctype() method doesn’t appear to be removed from the “default” (3.5?) branch either, here is a patch that avoids the deprecation warning when inheriting method + a test. Hopefully this will be useful when you get some time to look at it. I’m not

[issue634412] RFC 2387 (multipart/related) in email package

2014-12-16 Thread Martin Panter
Changes by Martin Panter : -- title: RFC 2387 in email package -> RFC 2387 (multipart/related) in email package ___ Python tracker <http://bugs.python.org/issue

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

2014-12-16 Thread Martin Panter
Martin Panter added the comment: Here is a patch with my suggestion. It also now refers to _the_ dictionary rather than just _a_ dictionary, and drops the word “current”, so that it does not sound like saving a snapshot. -- keywords: +patch Added file: http://bugs.python.org/file37478

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

2014-12-16 Thread Martin Panter
Changes by Martin Panter : Removed file: http://bugs.python.org/file37478/globals-copy.patch ___ Python tracker <http://bugs.python.org/issue19737> ___ ___ Python-bug

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

2014-12-16 Thread Martin Panter
Changes by Martin Panter : Added file: http://bugs.python.org/file37479/globals-copy.patch ___ Python tracker <http://bugs.python.org/issue19737> ___ ___ Python-bug

[issue20059] Inconsistent urlparse/urllib.parse handling of invalid port values?

2014-12-16 Thread Martin Panter
Martin Panter added the comment: I would go for raising ValueError for port numbers out of range. The value of None was already defined to mean that no port is included in the URL. Also, the ValueError exception should be documented. It is surprising that urlsplit() does not raise any

[issue18828] urljoin behaves differently with custom and standard schemas

2014-12-16 Thread Martin Panter
Martin Panter added the comment: I think a global registry seems like overkill. Here is a patch to make urljoin() treat schemes more equally and work with arbitrary schemes automatically. I haven’t heard any arguments against this option yet, and it didn’t break any tests. Another option

[issue23071] codecs.__all__ incomplete

2014-12-16 Thread Martin Panter
New submission from Martin Panter: First ones I noticed were codecs.encode() and codecs.decode(). Here is a list of other candidates, although they are not all documented, so maybe should not all be in __all__. >>> import codecs >>> public = (a for a in dir(codecs) i

[issue23071] codecs.__all__ incomplete

2014-12-16 Thread Martin Panter
Martin Panter added the comment: Okay I will try and make a patch for this once I have finished a patch to revise the documentation for Issue 19548 -- ___ Python tracker <http://bugs.python.org/issue23

[issue20121] quopri_codec newline handling

2014-12-17 Thread Martin Panter
Martin Panter added the comment: RFC 1521 says that a text newline should be encoded as CRLF, and that any combination of 0x0D and 0x0A bytes that do not represent newlines should be encoded like other control characters as =0D and =0A. Since in Python 3 the codec outputs bytes, I don’t think

[issue20121] quopri_codec newline handling

2014-12-17 Thread Martin Panter
Martin Panter added the comment: Okay so maybe the documentation should include these restrictions on encoding: * The data being encoded should only include \r or \n bytes that are part of \n or \r\n newline sequences. Encoding arbitrary non-text data is not supported. * The two kinds of

<    11   12   13   14   15   16   17   18   19   20   >