[issue20699] Document that binary IO classes work with bytes-likes objects

2016-06-10 Thread Martin Panter
Martin Panter added the comment: Thanks for you help figuring this out Serhiy, especially for the Python 2 case. -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue16484] pydoc generates invalid docs.python.org link for xml.etree.ElementTree and other modules

2016-06-10 Thread Martin Panter
Martin Panter added the comment: My guess is the file.startswith(basedir) in the getdocloc() method is getting tricked by non-canonical paths (e.g. lowercase vs uppercase C: drive?). Would it help to use something like os.path.normcase(), or maybe os.path.commonpath(), pathlib.PurePath.parts

[issue27272] random.Random should not read 2500 bytes from urandom

2016-06-10 Thread Martin Panter
Martin Panter added the comment: Victor originally opened this mentioning a 256-byte limit. I guess that comes from Open BSD’s getentropy() function: <http://man.openbsd.org/OpenBSD-current/getentropy.2>. Solaris’s getrandom() function <https://docs.oracle.com/cd/E53394_01/ht

[issue27296] Urllib/Urlopen IncompleteRead with HTTP header with new line characters

2016-06-11 Thread Martin Panter
Martin Panter added the comment: HTTP header fields are not supposed to have line breaks unless followed by a space or tab. So the server is actually providing a faulty response. However Python could do better at handling this case. There is already a bug open for this: Issue 24363. For the

[issue24363] httplib fails to handle semivalid HTTP headers

2016-06-11 Thread Martin Panter
Changes by Martin Panter : -- versions: +Python 3.6 -Python 3.4 ___ Python tracker <http://bugs.python.org/issue24363> ___ ___ Python-bugs-list mailing list Unsub

[issue27136] sock_connect fails for bluetooth (and probably others)

2016-06-11 Thread Martin Panter
Martin Panter added the comment: Revision 3f49e89be8a9 seems to be the cause of an x86 Tiger buildbot failure: http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/10924/steps/test/logs/stdio == FAIL

[issue27186] add os.fspath()

2016-06-11 Thread Martin Panter
Martin Panter added the comment: Test_fspath_protocol_bytes() (added in revision 5a62d682636e) fails on Windows: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds//steps/test/logs/stdio == ERROR

[issue16484] pydoc generates invalid docs.python.org link for xml.etree.ElementTree and other modules

2016-06-11 Thread Martin Panter
Martin Panter added the comment: Thanks Kaushik. I also changed the https:// detection to also detect http://, to maintain backwards compatibility. I am porting these changes to 2.7. -- versions: +Python 2.7 ___ Python tracker <h

[issue24136] document PEP 448: unpacking generalization

2016-06-12 Thread Martin Panter
Martin Panter added the comment: Thanks for the review. I committed my patch in the hope that it makes it into 3.5.2, but if people want to suggest further improvements etc that is okay. -- resolution: -> fixed stage: patch review -> resolved status: open -&g

[issue15649] subprocess.Popen.communicate: accept str for input parameter if universal_newlines is False

2016-06-12 Thread Martin Panter
Martin Panter added the comment: See also Issue 27273, proposing to use text string input as an indicator to turn on universal_newlines=True in the higher-level functions. I’m not excited by either proposal, but I find the other one a bit more palatable. IMO allowing text string input to

[issue12623] "universal newlines" subprocess support broken with select- and poll-based communicate()

2016-06-12 Thread Martin Panter
Martin Panter added the comment: . Summary: There was originally a bug, but it has been fixed. At best, we leave this open to work on including Andrew’s patch. Andrew’s patch adds a modified copy of test_universal_newlines_communicate_stdin(). But it does not look correct, and would fail on

[issue16484] pydoc generates invalid docs.python.org link for xml.etree.ElementTree and other modules

2016-06-12 Thread Martin Panter
Changes by Martin Panter : -- status: open -> closed ___ Python tracker <http://bugs.python.org/issue16484> ___ ___ Python-bugs-list mailing list Unsubscrib

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

2016-06-12 Thread Martin Panter
Martin Panter added the comment: . Michael, how are you supposed to apply your latest patch? I have Gnu Patch 2.7.5, but even in the best case it doesn’t find the files to patch: $ patch -p1 -n < python.Lib.ctypes.160608.patch can't find file to patch at input line 2 The text leadi

[issue16182] readline: Wrong tab completion scope indices in Unicode terminals

2016-06-12 Thread Martin Panter
Martin Panter added the comment: I updated the patch to fix the error handling and memory leak. it also now skips the test in case the locale cannot encode the test data. -- Added file: http://bugs.python.org/file43359/readline_locale.v4.patch

[issue17239] XML vulnerabilities in Python

2016-06-12 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +Avoid entity expansion attacks in Element Tree, xml.sax and xml.dom fetch DTDs by default ___ Python tracker <http://bugs.python.org/issue17

[issue27136] sock_connect fails for bluetooth (and probably others)

2016-06-12 Thread Martin Panter
Martin Panter added the comment: Okay changing to ::1 might have a decent chance of success. If nobody else comes forward, I can try committing it and see if it fixes the buildbot. -- ___ Python tracker <http://bugs.python.org/issue27

[issue26721] Avoid socketserver.StreamRequestHandler.wfile doing partial writes

2016-06-12 Thread Martin Panter
Martin Panter added the comment: Merged with current code, and migrated the interrupted-write test from test_wsgiref into test_socketserver. -- Added file: http://bugs.python.org/file43365/buffered-wfile.v3.patch ___ Python tracker <h

[issue26721] Avoid socketserver.StreamRequestHandler.wfile doing partial writes

2016-06-12 Thread Martin Panter
Martin Panter added the comment: Forgot to remove the workaround added to 3.5 for wsgiref in Issue 24291 -- Added file: http://bugs.python.org/file43366/buffered-wfile.v4.patch ___ Python tracker <http://bugs.python.org/issue26

[issue24363] httplib fails to handle semivalid HTTP headers

2016-06-12 Thread Martin Panter
Martin Panter added the comment: See also Issue 26686; the same problem, but with parsing RFC5322 header fields, rather than HTTP. -- ___ Python tracker <http://bugs.python.org/issue24

[issue10839] email module should not allow some header field repetitions

2016-06-12 Thread Martin Panter
Martin Panter added the comment: There are already the makings of an alternative API: https://docs.python.org/3.6/library/email.message.html#email.message.Message.add_header There is also replace_header(), but it only replaces the _first_ header field, and leaves later ones untouched. However

[issue25476] close() behavior on non-blocking BufferedIO objects with sockets

2016-06-12 Thread Martin Panter
Martin Panter added the comment: I propose to reject this. Close() should always close the underlying file descriptor or socket, even if there is a blocking error or other exception. -- resolution: -> rejected status: open -> pending ___

[issue26292] Raw I/O writelines() broken for non-blocking I/O

2016-06-12 Thread Martin Panter
Martin Panter added the comment: Victor, why did you change the title to specify non-blocking mode? I think blocking mode can also be handled at the same time. I propose: 1. In existing versions (2.7, 3.5): Document that it is undefined what IOBase.writelines() will do if a write() call does

[issue27186] add os.fspath()

2016-06-12 Thread Martin Panter
Martin Panter added the comment: Should the skip logic perhaps check for sys.platform == "win32" instead? The buildbots are still failing. -- ___ Python tracker <http://bugs.python.o

[issue27186] add os.fspath()

2016-06-13 Thread Martin Panter
Martin Panter added the comment: I went with os.name == "nt", which is what other scandir() tests use. I’m not sure there is a practical different. Anyway the buildbots seem happier now. -- ___ Python tracker <http://bugs.python.o

[issue26686] email.parser stops parsing headers too soon.

2016-06-13 Thread Martin Panter
Martin Panter added the comment: FWIW in the HTTP bug <https://bugs.python.org/issue24363#msg244676>, David said “when seeing a line that doesn't look like a header the error recovery is to treat that line as the beginning of the body (ie: assume the blank line is missing).

[issue12855] linebreak sequences should be better documented

2016-06-13 Thread Martin Panter
Martin Panter added the comment: Alexander: does my latest patch linebreakdoc.v5.py2.7.patch address your concerns about the 2.7 documentation? If so, I can push it to the repository. -- ___ Python tracker <http://bugs.python.org/issue12

[issue27311] Incorrect documentation for zipfile.writestr()

2016-06-13 Thread Martin Panter
Martin Panter added the comment: Looks like you are right. The change in the implementation happened in revision 19196cce1431. -- keywords: +easy nosy: +martin.panter stage: -> needs patch versions: -Python 3.4 ___ Python tracker &l

[issue16182] readline: Wrong tab completion scope indices in Unicode terminals

2016-06-13 Thread Martin Panter
Martin Panter added the comment: I get two other test suite failures if I set PYTHONIOENCODING, so I am not going to bother addressing this in test_readline :) FAIL: test_forced_io_encoding (test.test_capi.EmbeddingTests) FAIL: test_7 (test.test_pkg.TestPkg

[issue22636] avoid using a shell in ctypes.util: replace os.popen with subprocess

2016-06-13 Thread Martin Panter
Martin Panter added the comment: Updated Py 2 patch to v5 with the added GCC comment -- Added file: http://bugs.python.org/file43383/ctypes_util_popen-5.py2.patch ___ Python tracker <http://bugs.python.org/issue22

[issue22636] avoid using a shell in ctypes.util: replace os.popen with subprocess

2016-06-13 Thread Martin Panter
Martin Panter added the comment: An Open Indiana buildbot failed. The old code let the shell print any errors about missing programs to /dev/null, so I will change the subprocess calls to handle OSError. == ERROR: setUpModule

[issue27136] sock_connect fails for bluetooth (and probably others)

2016-06-13 Thread Martin Panter
Martin Panter added the comment: Buildbots look happy with test_asyncio now, so closing again. -- status: open -> closed ___ Python tracker <http://bugs.python.org/issu

[issue16182] readline: Wrong tab completion scope indices in Unicode terminals

2016-06-13 Thread Martin Panter
Martin Panter added the comment: Failures from AMD64 Snow Leop buildbots: == FAIL: test_nonascii_history (test.test_readline.TestHistoryManipulation

[issue8637] Add MANPAGER envvar to specify pager for pydoc

2016-06-13 Thread Martin Panter
Martin Panter added the comment: Matthias: your change causes pydoc to raise KeyError if I set MANPAGER but not PAGER. I’m guessing you intended something else? -- nosy: +martin.panter versions: +Python 3.6 -Python 3.3 ___ Python tracker <h

[issue8637] Add MANPAGER envvar to specify pager for pydoc

2016-06-14 Thread Martin Panter
Martin Panter added the comment: Thanks, that version looks more sensible -- ___ Python tracker <http://bugs.python.org/issue8637> ___ ___ Python-bugs-list mailin

[issue27315] pydoc: prefer the pager command in favor of the specifc less command

2016-06-14 Thread Martin Panter
Martin Panter added the comment: Does Debian use PAGER or MANPAGER? What’s the advantage of the “pager” command in addition? -- nosy: +martin.panter ___ Python tracker <http://bugs.python.org/issue27

[issue16182] readline: Wrong tab completion scope indices in Unicode terminals

2016-06-14 Thread Martin Panter
Martin Panter added the comment: Also need a fix for missing set_pre_input_hook() on the AIX buildbot: == FAIL: test_nonascii (test.test_readline.TestReadline

[issue24363] httplib fails to handle semivalid HTTP headers

2016-06-14 Thread Martin Panter
Martin Panter added the comment: I made a patch to fix all header section parsing by default in the email module (see Issue 26686). I’m not 100% sure if it is safe in general, but if it is, it would fix this bug. -- dependencies: +email.parser stops parsing headers too soon

[issue22636] avoid using a shell in ctypes.util: replace os.popen with subprocess

2016-06-14 Thread Martin Panter
Martin Panter added the comment: Updated Py 2 patch to handle OSError when shell=True is not used -- Added file: http://bugs.python.org/file43387/ctypes_util_popen-6.py2.patch ___ Python tracker <http://bugs.python.org/issue22

[issue27311] Incorrect documentation for zipfile.writestr()

2016-06-14 Thread Martin Panter
Martin Panter added the comment: Thanks John -- stage: needs patch -> commit review ___ Python tracker <http://bugs.python.org/issue27311> ___ ___ Python-

[issue27278] py_getrandom() uses an int for syscall() result

2016-06-14 Thread Martin Panter
Martin Panter added the comment: Yeah I think your change is enough. Adding a cast would solve this compiler warning: Python/random.c:168:17: warning: conversion to ‘int’ from ‘long int’ may alter its value [-Wconversion] n = syscall(SYS_getrandom, dest, n, flags

[issue16182] readline: Wrong tab completion scope indices in Unicode terminals

2016-06-14 Thread Martin Panter
Martin Panter added the comment: Think I got all the bugs fixed here. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue27311] Incorrect documentation for zipfile.writestr()

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

[issue12855] linebreak sequences should be better documented

2016-06-14 Thread Martin Panter
Changes by Martin Panter : -- stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.org/issue12855> ___ ___ Pyth

[issue27130] zlib: OverflowError while trying to compress 2^32 bytes or more

2016-06-15 Thread Martin Panter
Martin Panter added the comment: Thanks for working on this. I did a pass over your patch and left a bunch of comments. -- stage: needs patch -> patch review ___ Python tracker <http://bugs.python.org/issu

[issue27328] Documentation corrections for email defects

2016-06-15 Thread Martin Panter
New submission from Martin Panter: In trying to understand the defects from parsing an email Message object, and trying to use the raise_on_defect=True mode, I found a few inconsistencies with the documentation. I made a preliminary patch, but it may need adjusting. 1. There is no class

[issue24364] Not all defects pass through email policy

2016-06-15 Thread Martin Panter
Martin Panter added the comment: In particular, I noticed InvalidHeaderDefect is not raised if a header line begins with a colon (:), and also MisplacedEnvelopeHeaderDefect, if a header line begins "From ", including a space, and is neither the first or last line of the head

[issue27329] Document behavior when CDLL is called with None as an argument on POSIX systems

2016-06-15 Thread Martin Panter
Changes by Martin Panter : -- stage: -> needs patch ___ Python tracker <http://bugs.python.org/issue27329> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue27292] Warn users that os.urandom() can return insecure values

2016-06-16 Thread Martin Panter
Martin Panter added the comment: As far as this bug goes, 3.5 is not very different from 2.7 -- nosy: +martin.panter versions: +Python 2.7 ___ Python tracker <http://bugs.python.org/issue27

[issue27292] Warn users that os.urandom() can return insecure values

2016-06-16 Thread Martin Panter
Martin Panter added the comment: Here is a possible patch for 3.5+ based on my modest understanding of the concerns about insecure results and blocking. I hope that my wording is clear, couldn’t be confused with Linux’s /dev/random blocking and running out of fresh entropy, etc. I also tried

[issue27330] Possible leaks in ctypes

2016-06-16 Thread Martin Panter
Martin Panter added the comment: Mostly looks good. I left a two comments. -- nosy: +martin.panter ___ Python tracker <http://bugs.python.org/issue27330> ___ ___

[issue22228] Adapt bash readline operate-and-get-next function

2016-06-16 Thread Martin Panter
Martin Panter added the comment: I will try to have a closer look at this some time, but my immediate worry is it looks like you are directly copying Bash code (GPL) into Python (less restrictive license). Perhaps a more general solution would be to expose rl_add_defun() to native Python

[issue27292] Warn users that os.urandom() can return insecure values

2016-06-16 Thread Martin Panter
Martin Panter added the comment: Rebased so Rietveld can work with it, earlier version was my fault. As far as I can see (looking at Python/random.c and configure.ac), the Solaris version should also use GRND_NONBLOCK: #ifdef MS_WINDOWS #elif defined(HAVE_GETENTROPY) && !defined(su

[issue27335] Clarify that writing to locals() inside a class body is supported

2016-06-16 Thread Martin Panter
Martin Panter added the comment: I think my proposed patch for Issue 17546 addresses this. That patch was also written to address Issue 17960. -- nosy: +martin.panter ___ Python tracker <http://bugs.python.org/issue27

[issue14562] urllib2 maybe blocks too long with small chunks

2016-06-16 Thread Martin Panter
Changes by Martin Panter : -- versions: -Python 3.2 ___ Python tracker <http://bugs.python.org/issue14562> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25724] SSLv3 test failure on Ubuntu 16.04 LTS

2016-06-16 Thread Martin Panter
Martin Panter added the comment: This patch was also posted to Issue 26867, with a bit more discussion and analysis, so closing as a duplicate. -- resolution: -> duplicate status: open -> closed superseder: -> test_ssl test_options fails on ubu

[issue26867] test_ssl test_options fails on ubuntu 16.04

2016-06-16 Thread Martin Panter
Martin Panter added the comment: FWIW I imagine Ubuntu overriding the option will break the example code in the documentation of clearing SSL_OP_NO_SSLv3: <https://docs.python.org/3.5/library/ssl.html#ssl.create_default_context>. If we keep that documentation, I think we should conti

[issue27340] bytes-like objects with socket.sendall(), SSL, and http.client

2016-06-16 Thread Martin Panter
New submission from Martin Panter: According to the documentation, HTTPSConnection.request() should accept arbitrary bytes-like objects, but this is not the case. Currently (since Issue 23756), a “bytes-like object” is defined to be anything that works with Python’s buffer API, as long as it

[issue23740] http.client request and send method have some datatype issues

2016-06-16 Thread Martin Panter
Changes by Martin Panter : -- dependencies: +bytes-like objects with socket.sendall(), SSL, and http.client ___ Python tracker <http://bugs.python.org/issue23

[issue23360] Content-Type when sending data with urlopen()

2016-06-16 Thread Martin Panter
Martin Panter added the comment: Fixed conflicts with recent changes -- versions: +Python 2.7 -Python 3.4 Added file: http://bugs.python.org/file43428/non-urlencoded.6.patch ___ Python tracker <http://bugs.python.org/issue23

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

2016-06-17 Thread Martin Panter
Martin Panter added the comment: FYI instead of changing the helper into a static method, I think you could have just called http.client._get_content_length(). I don’t understand why we need the new encode_chunked=True flag. Can’t urllib.request leave the Transfer-Encoding field up to

[issue19756] test_nntplib: sporadic failures, network isses? server down?

2016-06-17 Thread Martin Panter
Martin Panter added the comment: Thanks Berker. In this case the previous tests using the same NNTP connection object were skipped. First run: test_unknown_command (test.test_nntplib.NetworkedNNTPTests) ... ok test_welcome (test.test_nntplib.NetworkedNNTPTests) ... ok test_with_statement

[issue27292] Warn users that os.urandom() can return insecure values

2016-06-17 Thread Martin Panter
Martin Panter added the comment: Restored “On Linux” for the changed in 3.5.2 notice. I do think it is better to be general and future-proof, but that is a separate, less important issue to the main purpose of the patch. (I don’t know if Solaris’s version can block or not.) -- stage

[issue22636] avoid using a shell in ctypes.util: replace os.popen with subprocess

2016-06-17 Thread Martin Panter
Martin Panter added the comment: Sorry about impersonating your name as committer Victor. I have been fixing this problem in recent patches, but because I imported your patch a while ago I forgot about it. -- resolution: -> fixed stage: patch review -> resolved status: open -&g

[issue25548] Show the address in the repr for class objects

2016-06-17 Thread Martin Panter
Martin Panter added the comment: There is also Issue 13224 proposing to change __str__() to just return the __name__ or __qualname__ if I remember correctly. -- nosy: +martin.panter ___ Python tracker <http://bugs.python.org/issue25

[issue26536] Add the SIO_LOOPBACK_FAST_PATH option to socket.ioctl

2016-06-18 Thread Martin Panter
Martin Panter added the comment: This is failing on Windows 7 buildbots: http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/7849/steps/test/logs/stdio == ERROR: test_sio_loopback_fast_path

[issue24314] irrelevant cross-link in documentation of user-defined functions

2016-06-18 Thread Martin Panter
Martin Panter added the comment: I also backported most of my changes to 2.7, although __name__ wasn’t originally linking to anything at all there. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -P

[issue19884] Importing readline produces erroneous output

2016-06-18 Thread Martin Panter
Martin Panter added the comment: Yogesh: Victor’s patch has already been applied. What is left to do is another patch that enables Victor’s code on OS X when Gnu Readline is being used, as opposed to the usual Apple Editline. Also, I think it is valid to update the version check to 6.1

[issue19884] Importing readline produces erroneous output

2016-06-18 Thread Martin Panter
Martin Panter added the comment: Here is a patch to enable the workaround on OS X, and to adjust the test condition to 6.1. It would be nice if someone with OS X and Gnu Readline can confirm that this fixes the problem. -- stage: needs patch -> patch review Added file: h

[issue27346] Implement os.readv() / os.writev()

2016-06-18 Thread Martin Panter
Changes by Martin Panter : -- components: +Extension Modules, Windows -Library (Lib) nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker <http://bugs.python.org/issue27

[issue25717] tempfile.TemporaryFile fails when dir option set to directory residing on host OS mount

2016-06-18 Thread Martin Panter
Martin Panter added the comment: Are you sure Oleg? As far as I understand, Python 2 by default wraps C stdio file objects, and also has Python 3’s file objects in the “io” module. But I expect TemporaryFile() would use the default stdio files, and the cause of this bug, Issue 21679, should

[issue25717] tempfile.TemporaryFile fails when dir option set to directory residing on host OS mount

2016-06-18 Thread Martin Panter
Martin Panter added the comment: This original bug was about fstat() failing for an anonymous file (after the directory entry was removed). But in your situation the file system refuses to unlink the directory entry. If you think there is something that can be fixed in Python, I suggest open

[issue27348] Non-main thread exception handler drops exception message

2016-06-18 Thread Martin Panter
New submission from Martin Panter: If the exception argument is None or repr(None), it is omitted from the report when a thread raises an unhandled exception: >>> def raise_exception(e): ... raise e ... >>> t = Thread(target=raise_exception, args=(Exception

[issue19756] test_nntplib: sporadic failures, network isses? server down?

2016-06-18 Thread Martin Panter
Martin Panter added the comment: Here is a patch that changes all affected tests to use a custom server running on localhost: * Local server is based on the existing NNTPv2Handler class, and the LocalServerTests class * Reintegrate test_starttls() back into NetworkedNNTPTestsMixin * Only

[issue19756] test_nntplib: sporadic failures, network isses? server down?

2016-06-19 Thread Martin Panter
Martin Panter added the comment: Here is a diff that shows my changes better. I temporarily moved some classes back to their original positions to reduce the diff size, though it won’t work in practice because Python needs the classes defined before using them. -- Added file: http

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

2016-06-19 Thread Martin Panter
Martin Panter added the comment: Uploading a combined patch that should work with Rietveld, and I will leave some comments. I don’t think there is much that I am comfortable changing in Python 2.7. In general it is a bad idea to add new features that are only going to be available in e.g

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

2016-06-19 Thread Martin Panter
Martin Panter added the comment: I left a few more comments, but I see that many of my earlier comments (both in Rietveld and main bug thread) still apply. I’m still struggling to understand all the special cases for the find_library() argument. You seem to have added even more recently

[issue27328] Documentation corrections for email defects

2016-06-20 Thread Martin Panter
Martin Panter added the comment: Here is a new version which I think should be okay to apply. I restored the references to the base class, but now using the MessageDefect name. I removed the changes relating to raise_on_defect not being strict, in favour of fixing Issue 24364

[issue24364] Not all defects pass through email policy

2016-06-20 Thread Martin Panter
Martin Panter added the comment: Here is a patch to fix the two defects in Lib/email/feedparser.py. I also made some extra changes to the tests: * Remove some tests from Lib/test/test_email/test_email.py, because I think they were redundant with methods of the same name in

[issue26292] Raw I/O writelines() broken for non-blocking I/O

2016-06-20 Thread Martin Panter
Martin Panter added the comment: Here is a patch documenting that RawIOBase.writelines() is undefined for partial writes and blocking errors, as mentioned in (1) above. The alternative of requiring write() to be retried would IMO be unfair to existing writelines() implementations. It also

[issue26894] Readline not aborting line edition on sigint

2016-06-20 Thread Martin Panter
Changes by Martin Panter : -- status: open -> pending ___ Python tracker <http://bugs.python.org/issue26894> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue12833] Document the need to pass the prompt to raw_input() with readline

2016-06-20 Thread Martin Panter
Changes by Martin Panter : -- stage: patch review -> needs patch title: raw_input misbehaves when readline is imported -> Document the need to pass the prompt to raw_input() with readline versions: -Python 3.4 ___ Python tracker

[issue10116] Sporadic failures in test_urllibnet

2016-06-20 Thread Martin Panter
Martin Panter added the comment: It looks like Antoine’s second failure (test_getcode) should be fixed now that transient_internet() is used (Issue 12138). Looking at Antoine’s first failure, it will always be possible for it to fail depending on the conditions of the buildbot, internet, and

[issue1606233] readline on popen3 file returns empty string before end

2016-06-20 Thread Martin Panter
Changes by Martin Panter : -- versions: -Python 3.1, Python 3.2 ___ Python tracker <http://bugs.python.org/issue1606233> ___ ___ Python-bugs-list mailin

[issue18300] script_helper._assert_python should set TERM='' by default.

2016-06-20 Thread Martin Panter
Martin Panter added the comment: More recently, Issue 19884 has worked around the problem where practical on non-Apple platforms, so perhaps this problem is not so important now. However it could still be present with older Gnu Readline versions, and slightly newer versions on Apple (pending

[issue12186] readline.replace_history_item still leaks memory

2016-06-20 Thread Martin Panter
Martin Panter added the comment: This seems like something that should be fixed in Readline, rather than Python. Judging by the rl_clear_history() documentation, it sounds like this is private data. Maybe we need a version of rl_free_undo_list() that works for old history items, or a Readline

[issue23297] Clarify error when ‘tokenize.detect_encoding’ receives text

2016-06-20 Thread Martin Panter
Changes by Martin Panter : -- stage: -> needs patch title: ‘tokenize.detect_encoding’ is confused between text and bytes: no ‘startswith’ method on a byte string -> Clarify error when ‘tokenize.detect_encoding’ receives text type: crash -> behavior versions: +Python 3.5, P

[issue24727] Wrap rl_forced_update_display() and lock readline module while active

2016-06-20 Thread Martin Panter
Martin Panter added the comment: I wonder why you can’t add the locking around input() calls at a higher level, rather than needing to change the readline module itself. -- stage: -> patch review title: Expand readline module -> Wrap rl_forced_update_display() and lock re

[issue17507] To add history time format in readline

2016-06-20 Thread Martin Panter
Martin Panter added the comment: Is this related to Readline’s history_write_timestamps() feature, or is this a request for Python to make a custom history file? -- components: +Extension Modules -Library (Lib) nosy: +martin.panter ___ Python

[issue25259] readline macros can segfault Python

2016-06-20 Thread Martin Panter
Martin Panter added the comment: I think Victor may be on the right track. Since the macro contains two newlines, a single call to rl_callback_read_char() is going to produce two calls back to the rl_callback_handler_install() handler to receive each line. I can make the example from the

[issue13376] readline: pre_input_hook not getting called

2016-06-20 Thread Martin Panter
Martin Panter added the comment: Surely this should be fixed in Editline, not Python? -- nosy: +martin.panter ___ Python tracker <http://bugs.python.org/issue13

[issue10415] readline.insert_text documentation incomplete

2016-06-20 Thread Martin Panter
Martin Panter added the comment: In Issue 6953, I updated the documentation to indicate which underlying Readline functions etc are accessed. So perhaps that helps, so the reader knows what function to look up in the Readline documentation. Other than that, I’m not sure what else to do. It

[issue19613] test_nntplib: sporadic failures, test_article_head_body()

2016-06-20 Thread Martin Panter
Martin Panter added the comment: I presume the original report was due to testing when the server happened to return an article with an empty body. The failing test is # XXX this could exceptionally happen... self.assertNotIn(article.lines[-1], (b".", b".\n", b".\r\n&

[issue1690201] Added support for custom readline functions

2016-06-20 Thread Martin Panter
Martin Panter added the comment: See also Issue 1175004, proposing the same sort of custom function, but called “py_callback”. -- nosy: +martin.panter ___ Python tracker <http://bugs.python.org/issue1690

[issue15730] Silence unused value warnings under Mac OS X 10.8/clang

2016-06-21 Thread Martin Panter
Martin Panter added the comment: Revisions 12e53abec5d0 and 0c7fff783b32 look like they do the same thing as Benno’s patch. Perhaps we can close this? -- nosy: +martin.panter resolution: -> out of date ___ Python tracker <http://bugs.pyth

[issue22463] Warnings when building on AIX

2016-06-21 Thread Martin Panter
Martin Panter added the comment: The most serious of these IMO is the signed overflow warnings in Modules/cPickle.c. I get the same warnings if I disable the “gcc -fwrapv” mode: /media/disk/home/proj/python/cpython/Modules/cPickle.c: In function ‘Unpickler_noload’: /media/disk/home/proj

[issue22463] Warnings when building on AIX

2016-06-21 Thread Martin Panter
Martin Panter added the comment: Looking closer at cPickle.c (after upgrading my GCC), I think there are two warnings happening, when Pdata_clear() is inlined into each of noload_reduce() and noload_setitem(). I think both cases are false positives; there is no actual signed overflow possible

[issue14826] urlopen URL with unescaped space

2016-06-21 Thread Martin Panter
Martin Panter added the comment: I think this should be treated as a feature, not a bug, since as Christian said, the documentation currently does not support this case. -- title: urllib2.urlopen fails to load URL -> urlopen URL with unescaped space type: -> enhancement ve

[issue26290] fileinput and 'for line in sys.stdin' do strange mockery of input buffering

2016-06-21 Thread Martin Panter
Martin Panter added the comment: Issue 15068 as been fixed in 3.5+ and 2.7, and it looks like it fixes the fileinput aspect of this bug. That leaves the sys.stdin aspect, which only affects Python 2, and I think is a duplicate of Issue 1633941. -- nosy: +martin.panter resolution

[issue26990] file.tell affect decoding

2016-06-21 Thread Martin Panter
Martin Panter added the comment: See also the second part of Issue 25863, a similar symptom with the iso-2022-jp codec. I suspect many of the multibyte CJK type codecs don’t properly support saving and restoring their state. -- nosy: +martin.panter

[issue20631] python readline module crashing on NULL access

2016-06-21 Thread Martin Panter
Martin Panter added the comment: I think an answer to Benjamin’s question is necessary to move this forward. The code already checks the index before calling history_get(). How do you manage to get null pointers returned for every history item? In the LLVM bug thread, I noticed “libedit

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