[issue30246] fix several error messages in struct

2017-09-13 Thread Martin Panter
Martin Panter added the comment: FWIW a similar change to the Struct constructor message was also proposed in Issue 19985. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/i

[issue19985] Not so correct error message when initializing Struct with ill argument

2017-09-13 Thread Martin Panter
Martin Panter added the comment: For Python 2.7, this change doesn’t seem important enough for a bug fix. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/i

[issue31447] proc communicate not exiting on python subprocess timeout using PIPES

2017-09-13 Thread Martin Panter
Martin Panter added the comment: I’m not familiar with Windows commands or processes enough, but going by Erik’s comment, this sounds similar to Issue 26534 and Issue 30154. Doesn’t your “waitfor” command inherit the same parent process’s stdout etc pipes? -- nosy: +martin.panter

[issue27815] Make SSL suppress_ragged_eofs default more secure

2017-09-12 Thread Martin Panter
Martin Panter added the comment: Even if some use cases depend on suppress_ragged_eofs=True, I think it is best to avoid that as the default. There could be a deprecation period if necessary. I tested some HTTP clients I had handy. In summary, most seemed to handle a truncation attack

[issue29396] Re-opening /dev/tty breaks readline

2017-09-08 Thread Martin Panter
Martin Panter added the comment: I agree it would be good to document when the Readline library is invoked. Yes, the “readline‭” module is only designed to work with the original sys.stdin and sys.stdout. Python’s “open” function does not use FILE objects, but Python does use FILE objects

[issue31366] Missing terminator option when using readline with socketserver.StreamRequestHandler

2017-09-08 Thread Martin Panter
Martin Panter added the comment: The socket.makefile(newline=...) parameter only affects text mode, but StreamRequestHandler’s “rfile” attribute works in byte mode. You could call makefile or TextIOWrapper yourself, but neither of these options support reading null-terminated “lines

[issue29396] Re-opening /dev/tty breaks readline

2017-09-06 Thread Martin Panter
Martin Panter added the comment: I think the difference between Python 2 and 3 here is that Python 2’s file objects, including sys.stdin, wrap C library FILE objects, which is supported by the Readline library. However Python 3 has its own kind of file objects, independent of standard C

[issue31365] Multiplication issue with 16.1

2017-09-06 Thread Martin Panter
Martin Panter added the comment: The floating-point numbers are only accurate to about 16 digits. You probably just found a value that cannot be exactly represented. https://docs.python.org/3.3/faq/design.html#why-are-floating-point-calculations-so-inaccurate -- nosy: +martin.panter

[issue31360] argparse mutually_exclusive_group under add_argument_group fails if part of parent_processor

2017-09-06 Thread Martin Panter
Martin Panter added the comment: Seems the same as two other open bugs: Issue 25882 and Issue 16807. -- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> argparse help error: arguments created by add_mutually_exc

[issue31320] test_ssl logs a traceback

2017-09-04 Thread Martin Panter
Martin Panter added the comment: Not sure if you just want to hide the presence of the exception and traceback. But regarding the exception itself (OSError with errno 0), this is not ideal. From memory, you tend to get this when the connection is shut down insecurely at the TCP level

[issue31262] Documentation Error

2017-08-22 Thread Martin Panter
Martin Panter added the comment: Assuming this is about the Classes section in the tutorial, you seem to be going down the same track as <https://github.com/python/cpython/pull/2696> -- nosy: +martin.panter ___ Python tracker <rep...@bugs.p

[issue31192] "return await coro()" SyntaxError despite being "valid syntax" in PEP 492

2017-08-12 Thread Martin Panter
Martin Panter added the comment: In 3.5, “await” is an ordinary identifier outside of “async def” functions. You have to use the “async def” syntax to enable it as a special keyword. >>> async def foo(): # “Async def” enables “await” as a keyword ... return await coro() # Val

[issue1732367] Document the constants in the socket module

2017-08-12 Thread Martin Panter
Martin Panter added the comment: The general rule for documenting availability seems to be to only list the special cases. Many of the socket options are specified by Posix, and seem to be available on Linux, Windows, BSD and other OSes. If you say “Availability: Linux, Windows”, it could

[issue1732367] Document the constants in the socket module

2017-08-11 Thread Martin Panter
Martin Panter added the comment: Issue 13256 contains a patch documenting socket options, but was closed because the author lost interest. Issue 27409 is a proposal to list the symbols available without documenting what each one is for. -- dependencies: +Document and test new socket

[issue31158] test_pty: test_basic() fails randomly on Travis CI

2017-08-09 Thread Martin Panter
Martin Panter added the comment: Checking for short writes is worthwhile, but in Issue 29070 it looks like Cornelius identified the main problem was short _reads_. See the parts of his patch to do with “_os_read_exactly” and related functions. -- nosy: +Cornelius Diekmann

[issue31136] raw strings cannot end with a backslash character r'\'

2017-08-07 Thread Martin Panter
Martin Panter added the comment: What would your proposal do where an embedded backslash is currently valid? >>> print(r'Backslash apostrophe: \'.') Backslash apostrophe: \'. >>> r'\' # Comment or string?' "\\' # Comment or string?" ---

[issue31122] SSLContext.wrap_socket() throws OSError with errno == 0

2017-08-04 Thread Martin Panter
Martin Panter added the comment: It might help if you explained what “atrocities” are happening on your network. Is there a proxy or man-in-the-middle (or the remote peer) that shuts down TCP connections? If so, perhaps this is similar to Issue 10808. From my memory, in that case an OS “recv

[issue31076] http.server should correctly handle HTTP 1.1 responses without a content-length

2017-07-29 Thread Martin Panter
Martin Panter added the comment: The trouble is you would also have to parse the Transfer-Encoding field, and have special logic for responses where Content-Length is not needed or irrelevant (certain combinations of method and status code). And even then you risk breaking rare or custom

[issue30576] http.server should support HTTP compression (gzip)

2017-07-25 Thread Martin Panter
Martin Panter added the comment: I think chunked encoding is only meant to be used for HTTP 1.1. For HTTP 1.0, you have to either send Content-Length, or shut down the connection after sending the body. See also Issue 21224 about improving HTTP 1.1 support. Maybe you should add a “Vary

[issue31025] io.BytesIO: no way to get the length of the underlying buffer without copying data

2017-07-25 Thread Martin Panter
Martin Panter added the comment: Can’t you use b.seek(0, SEEK_END)? -- nosy: +martin.panter versions: -Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue29606] urllib FTP protocol stream injection

2017-07-21 Thread Martin Panter
Martin Panter added the comment: Serhiy, that is what Dong-hee already proposed in <https://github.com/python/cpython/pull/1214>, but someone needs to decide if we want to support RFC 2640, in which I understand LF on its own is legal, and CR is escaped by adding

[issue30393] test_readline hangs

2017-07-09 Thread Martin Panter
Martin Panter added the comment: Thanks for the information. That narrows the problem down, but I still don’t exactly know why it hangs. A good workaround may be to put a timeout in the “select” call for a second or so, and if it times out, raise an exception which will fail the test but let

[issue27068] Add a detach() method to subprocess.Popen

2017-07-08 Thread Martin Panter
Martin Panter added the comment: Personally, I haven’t needed this feature. But I still think it may be a decent solution for the “webbrowser” module, potentially your “asyncio” problem, and other cases that could now trigger an unwanted ResourceWarning

[issue30319] Change socket.close() to ignore ECONNRESET

2017-07-05 Thread Martin Panter
Martin Panter added the comment: Thanks for handling this Victor. To answer some of your earlier questions, this is my understanding of the Free BSD behaviour (although I don't have Free BSD to experiment with): When writing to TCP sockets, I believe the data is buffered by the local OS

[issue19613] test_nntplib: sporadic failures, test_article_head_body()

2017-07-02 Thread Martin Panter
Martin Panter added the comment: It looks like I was fairly confident about my patch, but it was all theoretical and I was never able to analyze the failure myself. Sorry but I am unlikely to spend much time on this or open a pull request any time soon

[issue30713] Reject newline character (U+000A) in URLs in urllib.parse

2017-07-02 Thread Martin Panter
Martin Panter added the comment: It might help if you explained why you want to make these changes. Otherwise I have to guess. Is a compromise between strictly rejecting all non-URL characters (not just control characters), versus leaving it up to user applications to validate their URLs? I

[issue29926] IDLE: in shell, time.sleep ignores _thread.interrupt_main()

2017-07-01 Thread Martin Panter
Martin Panter added the comment: I doubt the Gnu Readline library nor Python’s readline module are relevant. The input function only uses Readline if sys.stdin is the original stdin terminal; I suspect Idle monkey-patches sys.stdin. The readline method reads directly from the file object

[issue30391] test_threading_handled() of test_socketserver hangs randomly on AMD64 FreeBSD 10.x Shared 3.6

2017-06-30 Thread Martin Panter
Martin Panter added the comment: These tests are supposed to: 1. Create a TCP server 2. Open a TCP connection 3. Run a custom connection handler (depending on the particular test) in a new thread 4. When the handler returns, the new thread should call “shutdown_request” 5. Shutdown_request

[issue30319] ConnectionResetError: [Errno 54] Connection reset by peer in socket.close on FreeBSD, Py 3.6

2017-06-30 Thread Martin Panter
Martin Panter added the comment: I think fixing all affected calls to socket.close in the world (option 3) would be too much. I just added two new reports (Issue 30652 and Issue 30391) as dependencies. These are about testing socketserver.TCPServer. As an example, to fix the socket.close call

[issue30319] ConnectionResetError: [Errno 54] Connection reset by peer in socket.close on FreeBSD, Py 3.6

2017-06-30 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- dependencies: +test_threading_handled() of test_socketserver hangs randomly on AMD64 FreeBSD 10.x Shared 3.6, test_threading_not_handled() of test_socketserver hangs randomly on AMD64 FreeBSD 10.x Shar

[issue30302] Improve .__repr__ implementation for datetime.timedelta

2017-06-30 Thread Martin Panter
Martin Panter added the comment: Don’t let my minus sign suggestion stop this, especially since a couple other people said they don’t like it. The current pull request proposal is beneficial without it. Isn’t there a “Unicode writer” API that could be used? Maybe that’s another alternative

[issue30754] textwrap.dedent mishandles empty lines

2017-06-26 Thread Martin Panter
Martin Panter added the comment: Some people like to avoid indented blank lines, treating them the same as trailing whitespace. I suspect this behaviour may be intentional. -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org>

[issue30576] http.server should support HTTP compression (gzip)

2017-06-24 Thread Martin Panter
Martin Panter added the comment: For existing “.gz” files, I wasn’t suggesting to compress them a second time, just for the server report that they are already compressed, like how it reports the Content-Type value based on the file name. Including Content-Encoding would help browsers display

[issue30716] Failing tests with installed 3.6.2rc1 on Win 10-64

2017-06-20 Thread Martin Panter
Martin Panter added the comment: Sounds similar to Issue 27425. Did rc1 get built with mangled newlines or something? -- components: +Tests, Windows nosy: +martin.panter, paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker <

[issue24465] Make shutil.make_archive have deterministic sorting

2017-06-18 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- dependencies: +tarfile add uses random order title: Make tarfile have deterministic sorting -> Make shutil.make_archive have deterministic sorting ___ Python tracker <rep...@bugs.pytho

[issue30576] http.server should support HTTP compression (gzip)

2017-06-17 Thread Martin Panter
Martin Panter added the comment: I think neither Pierre’s nor Glenn’s implementations should be added to SimpleHTTPRequestHandler. In fact I think most forms of content negotiation are only appropriate for a higher-level server. It seems too far removed from the intention of the class

[issue30625] Documentation is unclear how "y*" and "y#" format units vary

2017-06-16 Thread Martin Panter
Martin Panter added the comment: Issue 24009 proposes deprecating y# (among other units). IMO the documentation and error message aren’t specific enough regarding the reference to “bytes-like”. -- nosy: +martin.panter ___ Python tracker <

[issue18140] urlparse, urlsplit confused when password includes fragment (#), query (?)

2017-06-16 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- dependencies: +[security] urllib connects to a wrong host ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue25026] (FreeBSD/OSX) Fix fcntl module to accept 'unsigned long' type commands for ioctl(2).

2017-06-14 Thread Martin Panter
Martin Panter added the comment: Maybe Issue 16124 is related; it mentions 64-bit values, but it sounds like an obscure use case. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30669] json.tool does not accept an --indent flag

2017-06-14 Thread Martin Panter
Martin Panter added the comment: Issue 29636 looks related -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue27485] urllib.splitport -- is it official or not?

2017-06-13 Thread Martin Panter
Martin Panter added the comment: I don't think it is worth changing the implementations to be in terms of urlsplit or urlparse. This is proposed for splithost in <https://github.com/python/cpython/pull/1849>, but I suspect it would change the behaviour in some corner cases. See Issue

[issue23019] pyexpat.errors wrongly bound to message strings instead of message codes

2017-06-05 Thread Martin Panter
Martin Panter added the comment: Also, even in the Py 3 docs, the ErrorCode parser attribute is said to be numeric, but there is a suggestion to compare it with “constants” defined in the “errors” (module) object. I guess it should be clarified that you can’t compare it directly; perhaps

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

2017-06-05 Thread Martin Panter
Martin Panter added the comment: Yes I think I committed all the documentation. Someone needs to decide whether to use Andy’s tests as they are, or perhaps modify or drop some or all of them. -- ___ Python tracker <rep...@bugs.python.org>

[issue30576] http.server should support HTTP compression (gzip)

2017-06-05 Thread Martin Panter
Martin Panter added the comment: Why do you want to this? Encoding files on the fly seems out of scope of the SimpleHTTPRequestHandler class to me, but perhaps a more flexible API that could be plugged in by the user could be beneficial. See

[issue30315] test_ftplib.TestTLS_FTPClass: "[Errno 54] Connection reset by peer" on "AMD64 FreeBSD CURRENT Debug 3.x" buildbot

2017-06-03 Thread Martin Panter
Martin Panter added the comment: See <https://bugs.python.org/issue30319#msg295109> about the “socket.close” exception, which should only affect 3.6+. But the 2.7 “recv” exception is a bit different. -- nosy: +martin.panter ___ Python tracke

[issue30319] ConnectionResetError: [Errno 54] Connection reset by peer in socket.close on FreeBSD, Py 3.6

2017-06-03 Thread Martin Panter
Martin Panter added the comment: Making this an index of related reports: Issue 30319: test_imap Issue 30315: test_ftplib Issue 30543: test_timeout Issue 30328: test_ssl Issue 27784: test_asyncore.TestAPI_UseIPv6Select.test_handle_accept, test_socketserver Issue 30106

[issue30558] [Suggestion] Improve documentation for set() API

2017-06-03 Thread Martin Panter
Martin Panter added the comment: Did you see <https://docs.python.org/3.6/library/stdtypes.html#set-types-set-frozenset>? -- assignee: -> docs@python components: +Documentation nosy: +docs@python, martin.panter status: open -> pending __

[issue30458] CRLF Injection in httplib

2017-06-03 Thread Martin Panter
Martin Panter added the comment: You can also inject proper HTTP header fields (or do multiple requests) if you omit the space after the CRLF: urlopen("http://localhost:8000/ HTTP/1.1\r\nHEADER: INJECTED\r\nIgnore:") Data sent to the server: >>> server = socket(A

[issue13359] urllib2 doesn't escape spaces in http requests

2017-06-02 Thread Martin Panter
Martin Panter added the comment: I think this could be merged with Issue 14826. Maybe it is sensible to handle all control characters the same way. -- nosy: +martin.panter resolution: -> duplicate superseder: -> urlopen URL with unescaped

[issue30516] Documentation for datetime substract operation incorrect?

2017-05-30 Thread Martin Panter
Martin Panter added the comment: The C "_datetime" implementation seems to handle this as documented. But either way, the "timedelta" range is greater than the "datetime" range, so it seems to be just a difference in OverflowError messages, not a big practi

[issue29596] Unfinished sentence in howto/clinic.rst

2017-05-29 Thread Martin Panter
Martin Panter added the comment: Currently for the “buffer” destination, it says Suppress . . ., write . . . to ``block``, and write everything else to ``file``. Would it be more correct to change “file“ to “buffer”? I.e. Suppress . . ., write . . . to ``block``, and write everything else

[issue30500] urllib connects to a wrong host

2017-05-28 Thread Martin Panter
Martin Panter added the comment: See also Issue 18140, where it looks like people _want_ the hash (#) to be part of the username and/or password. Another option may be to raise an exception. -- nosy: +martin.panter ___ Python tracker <

[issue30304] TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7

2017-05-26 Thread Martin Panter
Martin Panter added the comment: I think the simplest way forward would be to add the word “Unicode” back in. You could look at making a Git Hub pull request for this if you want. Hopefully somebody else can merge it though, because I probably won’t be in a position to do so for a while

[issue30393] test_readline hangs

2017-05-26 Thread Martin Panter
Martin Panter added the comment: Perhaps if you ran the tests in verbose mode, that could narrow down which test it hangs at. Also, if you can capture a KeyboardInterrupt stack trace, that may help. Not sure if it works with your build setup, but maybe you can run something like ./python -m

[issue30476] Add _GenerateCRCTable() to zipfile.py to pre-compute CRC Table

2017-05-26 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue30477] tuple.index error message improvement

2017-05-26 Thread Martin Panter
Martin Panter added the comment: Also discussed in Issue 13349 -- nosy: +martin.panter superseder: -> Non-informative error message in index() and remove() functions ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.or

[issue30441] os.environ raises RuntimeError: dictionary changed size during iteration

2017-05-24 Thread Martin Panter
Martin Panter added the comment: Previous report: Issue 25641. At least in Posix, the “putenv” function is not required to be thread safe. -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/i

[issue30437] SSL_shutdown can return meaningless SSL_ERROR_SYSCALL

2017-05-23 Thread Martin Panter
Martin Panter added the comment: Maybe Issue 10808? -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue30437> ___ __

[issue29321] Wrong documentation (Language Ref) for unicode and str comparison

2017-05-23 Thread Martin Panter
Martin Panter added the comment: I backported Issue 12067 documentation, so hopefully this is fixed. -- resolution: -> out of date stage: -> resolved status: open -> closed superseder: -> Doc: remove errors about mixed-type comparisons. __

[issue30435] Documentation either unclear or incorrect on comparisons between bytes and strings in Python 3

2017-05-23 Thread Martin Panter
Martin Panter added the comment: Also, “-bb” turns it into an exception, and the same applies to bytes vs int: >>> b"a" == "a" Traceback (most recent call last): File "", line 1, in BytesWarning: Comparison between bytes and string >>> b"

[issue30420] Clarify kwarg handing for subprocess convenience APIs

2017-05-21 Thread Martin Panter
Martin Panter added the comment: If you add “cwd” to Frequently Use Arguments, please try to keep the details in one place. Otherwise you encourage a fix for Issue 15533 (cwd platform specifics) to repeat the problem of Issue 20344 (args vs shell platform specifics), where some details

[issue30420] Clarify kwarg handing for subprocess convenience APIs

2017-05-20 Thread Martin Panter
Martin Panter added the comment: For the curious, Nick added the “frequently used arguments” in Issue 13237. Before that the signatures were like <https://docs.python.org/release/3.2.2/library/subprocess.html#convenience-functions>: subprocess.call(*popenargs, **kwargs) -

[issue30302] Improve .__repr__ implementation for datetime.timedelta

2017-05-20 Thread Martin Panter
Martin Panter added the comment: I think the benefit of the repr being easier to understand outweighs the pain of breaking the old format. If the change is a problem, that might be mitigated by adding an entry to the “Porting to Python 3.7” documentation. I don’t think my option of factoring

[issue23674] super() documentation isn't very clear

2017-05-20 Thread Martin Panter
Martin Panter added the comment: Cheryl: see also Issue 25777 and Issue 20751, both about the “super binding” under Invoking Descriptors. Raymond: if you want to just pick parts of my patch, go for it. But I don’t understand your concern about explaining the MRO. I think it is important

[issue20751] Misleading descriptor protocol documentation: direct call, super binding

2017-05-20 Thread Martin Panter
Martin Panter added the comment: Lower-case “a” is defined at the top of the list: “The starting point . . . is ‘a.x’.” The last entry may fit in better if it was written “If binding to an instance of ‘super’ ”. The problem with the m() call is also mentioned in Issue 25777, about

[issue29854] Segfault when readline history is more then 2 * history size

2017-05-19 Thread Martin Panter
Martin Panter added the comment: I suspect the test won’t be effective with Editline (either fail, or silently pass without testing the bug). From memory Editline uses an ~/.editrc file, not INPUTRC, with different syntax and configuration

[issue29619] st_ino (unsigned long long) is casted to long long in posixmodule.c:_pystat_fromstructstat

2017-05-19 Thread Martin Panter
Martin Panter added the comment: What is the advantage of compiling calls to both Long and LongLong converters? Isn’t it simpler to blindly call PyLong_FromUnsignedLongLong or similar? -- nosy: +martin.panter ___ Python tracker <

[issue30324] Error using newline='' when writing to CSV file

2017-05-09 Thread Martin Panter
Martin Panter added the comment: On Python 2, I'm guessing you are getting extra CRs on Windows? It looks like you have to open in binary mode there to avoid newline translation. This is documented for the "reader" and "wr

[issue30324] Error using newline='' when writing to CSV file

2017-05-09 Thread Martin Panter
Martin Panter added the comment: In Python 2, the "open" function doesn't have a "newline" parameter. Perhaps you were looking at the wrong documentation version. -- nosy: +martin.panter resolution: -> not a bug stage: -> resol

[issue30311] random.shuffle pointlessly shuffles dicts

2017-05-08 Thread Martin Panter
Martin Panter added the comment: It is also pointless to shuffle a list object repeating the same item, but that is no reason to add a special case. Is there a real problem with allowing dictionaries and OrderedDict? It seems to behave sensibly if you give each item a unique value: >&

[issue4963] mimetypes.guess_extension result changes after mimetypes.init()

2017-05-08 Thread Martin Panter
Martin Panter added the comment: I understand hash randomization was added after this bug was opened. Here is a demonstration with “video/mp4”, which only has the extension “.mp4” built in. But my /etc/mime.types file lists “mp4 mp4v mpg4”, so after the second initialization the behaviour

[issue4963] mimetypes.guess_extension result changes after mimetypes.init()

2017-05-08 Thread Martin Panter
Martin Panter added the comment: I suggest to discuss the non-determinism problem in Issue 1043134 (about determining a canonical extension for each content type). I understood this bug (Issue 4963) is about the behaviour of repeated initialization of the same instance of mimetypes. BTW

[issue29823] mimetypes guesses XSL mimetype when passed an XML file

2017-05-08 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <rep...@bugs.python.org> <http://bu

[issue30304] TestCase.assertMultiLineEqual only registered for Unicode strings in 2.7

2017-05-08 Thread Martin Panter
New submission from Martin Panter: In Mercurial revision 6e5b5d1b6714, the documentation for “assertMultiLineEqual” was changed from This method is used by default when comparing Unicode strings with “assertEqual”. to This method is used by default when comparing strings with “assertEqual

[issue30302] Improve .__repr__ implementation for datetime.timedelta

2017-05-07 Thread Martin Panter
Martin Panter added the comment: This was discussed fairly recently: <https://marc.info/?i=captjjmrbxpvyquyxshbc1j13m_h5or67cnbkrkysw4ef6rq...@mail.gmail.com>. There seems to be a bit of support for changing this. It is not a bug fix, so has to go into the next release, now 3.7. I di

[issue30097] Command-line option to suppress "from None" for debugging

2017-05-07 Thread Martin Panter
Martin Panter added the comment: This proposal would be useful. My use case is for when an API suppresses an external exception context: >>> import os >>> try: ... os.environ["NEW_VARIABLE"] = bug # Hidden exception ... finally: ... del os.environ

[issue25435] Wrong function calls and referring to not removed concepts in descriptor HowTo (documentation)

2017-05-06 Thread Martin Panter
Martin Panter added the comment: Raymond I suggest you unassign this and let others work on it. -- stage: patch review -> needs patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.or

[issue30292] Why is there a concept "unbound method" in python3 version?

2017-05-06 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> docs.python.org/3/howto/descriptor.html still refers to "unbound methods" ___

[issue12077] Harmonizing descriptor protocol documentation

2017-05-06 Thread Martin Panter
Martin Panter added the comment: See Issue 23702 specifically about unbound methods in Python 3, and Issue 25435 about general problems with the how-to in Python 3. -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org>

[issue4755] Add function to get common path prefix

2017-05-05 Thread Martin Panter
Martin Panter added the comment: Issue 10395 added “os.path.commonpath” in 3.5. -- nosy: +martin.panter resolution: -> duplicate stage: patch review -> resolved status: languishing -> closed superseder: -> new os.path function to extract common prefix based on path

[issue28149] Incorrect indentation under “else” in _bsddb.c

2017-05-03 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- resolution: -> duplicate stage: test needed -> resolved status: open -> closed superseder: -> _bsddb: else misleadingly indented ___ Python tracker <rep...@bugs.python.org>

[issue21790] Change blocksize in http.client to the value of resource.getpagesize

2017-05-01 Thread Martin Panter
Martin Panter added the comment: For plain-text (non-SSL) HTTP uploads, perhaps using “socket.sendfile” would help: Issue 13559. Another idea would be to expose and document the low-level socket (or SSL wrapper) and let the user copy data with whatever chunk size they desire. -- nosy

[issue30145] Create a How to or Tutorial documentation for asyncio

2017-04-30 Thread Martin Panter
Martin Panter added the comment: See Issue 27579, where Victor wanted to focus on <https://github.com/asyncio-doc/asyncio-doc> outside of Python. -- nosy: +haypo, martin.panter ___ Python tracker <rep...@bugs.python.org> <http://

[issue15346] Tkinter extention modules have no documentation

2017-04-30 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- dependencies: +No Documentation on tkinter dnd module ___ Python tracker <rep...@bugs.python.org> <http://bugs.python

[issue30119] (ftplib) A remote attacker could possibly attack by containing the newline characters

2017-04-29 Thread Martin Panter
Martin Panter added the comment: I suggest to close this as a duplicate. The pull request itself looks like the right direction to me, but let’s not split the discussion up more than necessary. -- nosy: +martin.panter resolution: -> duplicate superseder: -> urllib FTP pr

[issue30204] socket.setblocking(0) changes socket.type

2017-04-29 Thread Martin Panter
Martin Panter added the comment: Is this a duplicate of Issue 21327? There is some discussion there and a patch to add get_socket_type that excludes SOCK_NONBLOCK. -- nosy: +martin.panter superseder: -> socket.type value changes after using settime

[issue29606] urllib FTP protocol stream injection

2017-04-29 Thread Martin Panter
Martin Panter added the comment: I think changing FTPHandler may be more appropriate than urlsplit. But I thought your other pull request <https://github.com/python/cpython/pull/1214> in “ftplib” might be enough. Or are you trying to make it more user-friendly? Also, FTPHandler is no

[issue30103] uu package uses old encoding

2017-04-28 Thread Martin Panter
Martin Panter added the comment: I think I would prefer b2a_uu(data, grave=True), but am also happy with Xiang’s backtick=True if others prefer that. :) In my mind “grave accent” is the pure ASCII character; it just got abused for other things. Other options: b2a_uu(data, space=False) b2a_uu

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

2017-04-28 Thread Martin Panter
Martin Panter added the comment: I don’t think the API should be expanded to accept arbitrary bytes-like objects as format strings. Struct formats are strings of ASCII-compatible characters, but not arbitrary chunks of memory. I think the main question is whether it is okay to break

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

2017-04-28 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- dependencies: +struct.Struct.format is bytes, but should be str -Document whether it's safe to use bytes for struct format string ___ Python tracker <rep...@bugs.python.org> <http://

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

2017-04-28 Thread Martin Panter
Martin Panter added the comment: I think the direction to take for this depends on the outcome of Issue 21071. First we have to decide if the “format” attribute is blessed as a byte string (and not deprecated), or whether it is deprecated or changed to a text string. Serhiy pointed out

[issue29606] urllib FTP protocol stream injection

2017-04-28 Thread Martin Panter
Martin Panter added the comment: I understand this bug (as reported by ECBFTW) is about Python injecting unexpected FTP commands when the “urllib” and “urllib2” modules are used. The “httplib” module (“http.client” in Python 3) is unaffected. I only mentioned HTTP as an example of a similar

[issue30103] uu package uses old encoding

2017-04-27 Thread Martin Panter
Martin Panter added the comment: FWIW I am using NXP LPC microcontrollers at the moment, whose bootloader uses the grave/backtick instead of spaces. (NXP application note AN11229.) Although in practice it does seem to accept Python's spaces instead of graves. I wouldn't put too much weight

[issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear

2017-04-27 Thread Martin Panter
Martin Panter added the comment: The “Proper adherence” sentence has always bothered me. Why does “wfile” have to adhere, but not other other APIs (rfile, send_header, etc)? I wonder if the sentence is useful at all. (Of course you have to use HTTP to operate with HTTP clients.) Perhaps

[issue29606] urllib FTP protocol stream injection

2017-04-27 Thread Martin Panter
Martin Panter added the comment: Isn’t Issue 30119 a duplicate of this? In that bug Dong-hee you posted a pull request that changes the “ftplib” module, which makes more sense to me than adding a special case to “urlsplit” that understands FTP. See how this was addressed for HTTP in Issue

[issue28769] Make PyUnicode_AsUTF8 returning "const char *" rather of "char *"

2017-04-26 Thread Martin Panter
Changes by Martin Panter <vadmium...@gmail.com>: -- nosy: -martin.panter ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28769> ___

[issue26534] subprocess.check_output with shell=True ignores the timeout

2017-04-24 Thread Martin Panter
Martin Panter added the comment: Issue 5115 is already open with patch that has an alternative API to the low-level “killpg” method. It also has a Windows implementation and tests. I suggest to focus this bug on the higher-level “kill_group” option. -- dependencies: +Extend

[issue30154] subprocess.run with stderr connected to a pipe won't timeout when killing a never-ending shell commanad

2017-04-24 Thread Martin Panter
Martin Panter added the comment: This is similar to the problem described in Issue 26534, which proposes “kill_group” and “killpg” APIs as a solution. (FYI you should put a shebang at the start of the shell script, or call it as “sh -c test.sh”, to fix the “Exec format error

[issue26534] subprocess.check_output with shell=True ignores the timeout

2017-04-24 Thread Martin Panter
Martin Panter added the comment: I don’t know enough about process groups and sessions to properly review, but some things that stand out: * Patch is missing documentation and tests * If the “killpg” just wraps os.killpg, perhaps adding the method is not justified * Are there any race

[issue23404] 'make touch' does not work with git clones of the source repository

2017-04-24 Thread Martin Panter
Martin Panter added the comment: A while ago I wrote a patch targetting Issue 22359 that may be a starting point for “make regen”: <https://bugs.python.org/file42169/separate-regen.patch>. It pulled out three recipes into separate “phony” targets: “make graminit importlib importlib_ex

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