[issue32732] LoggingAdapter ignores extra kwargs of Logger#log()

2018-02-28 Thread Cyril Martin
Cyril Martin <mcool...@gmail.com> added the comment: Hi Stéphane, I ask you a question about the change you suggest. The PR has not progress. Do you wait something from me? -- ___ Python tracker <rep...@bugs.python.org> <https://

[issue32867] argparse assertion failure with multiline metavars

2018-02-23 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: This looks like the same assertion failure as described in Issue 16360. Paul pointed to a patch in Issue 11874, so that may also be relevant. However I agree that embedding newlines in a metavar doesn’t make much sense. What’s t

[issue32875] Add __exit__() method to event loops

2018-02-23 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Maybe already discussed in Issue 24795? -- nosy: +martin.panter superseder: -> Make event loops with statement context managers ___ Python tracker <rep...@bugs.python

[issue32732] LoggingAdapter ignores extra kwargs of Logger#log()

2018-01-31 Thread Cyril Martin
New submission from Cyril Martin <mcool...@gmail.com>: - LoggerAdapter processes only extra kwargs given during its __init__ So extra kwargs, given to Logger#log are ignored when we configure a LoggerAdapter (same for: debug, info, warning etc). - I expect extras are merged. More precis

[issue20104] expose posix_spawn(p)

2018-01-29 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Your assumption about calling “file_actions_destroy” would be okay if the posix_spawn_file_actions_t object was a simple object or structure. But I imagine most implementations would allocate memory when you call one of the “add” m

[issue20104] expose posix_spawn(p)

2018-01-29 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: TypeError if “posix_spawn_file_actions_init” fails doesn’t seem right. I suggest OSError, MemoryError, or even plain Exception instead. “File_actionsp” is set to point to a local variable “_file_actions”, but the variable go

[issue20104] expose posix_spawn(p)

2018-01-29 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Does the PySequence_Fast result need releasing if the following “for” loop fails? There is a Py_DECREF only in the successful case, which seems inconsistent. Does Python still support non-UTF-8 locales and bytes filenames? I haven’

[issue20104] expose posix_spawn(p)

2018-01-28 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Pablo’s code looked unfinished to me. As well as missing documentation, I suspect there may be memory leaks and poor error handling. The two calls above the “fail:” label look like dead code. The “parse_envlist” result a

[issue32698] Improper gzip compression if output file extension is not "gz"

2018-01-28 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: According to the documentation, you can use the lower-level GzipFile constructor’s “filename” argument: >>> with open(output_path, 'wb') as f_out, \ ... gzip.GzipFile(fileobj=f_out, mode='wb', filename=input

[issue32673] update tutorial dict part to reflect dict is ordered

2018-01-25 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: See Issue 32337 -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32668] deepcopy() fails on ArgumentParser instances

2018-01-25 Thread Martin Kolman
New submission from Martin Kolman <mkol...@redhat.com>: We (the Anaconda OS intaller team) are in the process of switching to a new version of a library (Pykickstart), which among other things switched from using optparse to argparse. And during this endeavour we found that it's appa

[issue32634] Message parsing fails where it has incompele headers

2018-01-23 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Looks like a dupe of Issue 27321 -- nosy: +martin.panter resolution: -> duplicate superseder: -> Email parser creates a message object that can't be flattened ___ Python

[issue26175] Fully implement IOBase abstract on SpooledTemporaryFile

2018-01-19 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: It may also be worth implementing BufferedIOBase and TextIOBase. (It seems buffering=0 isn’t reliable, e.g. rollover with limited disk space, so it may not be worth implementing RawIOBase.) To implement BufferedIOBase,

[issue32600] SpooledTemporaryFile should implement IOBase

2018-01-19 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: There is apparently some work done on this already in Issue 26175. -- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Fully implement IOBase abstract on Sp

[issue32561] Add API to io objects for non-blocking reads/writes

2018-01-15 Thread Martin Panter
Change by Martin Panter <vadmium...@gmail.com>: -- dependencies: +Add ability to query number of buffered bytes available on buffered I/O ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32561] Add API to io objects for non-blocking reads/writes

2018-01-15 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: BufferedIOBase is an abstract class and, despite the name, doesn’t necessitate a buffer or cache. Adding methods and properties might break compatibility with third-party implementations, or get ugly with optional methods and mu

[issue32475] Add ability to query number of buffered bytes available on buffered I/O

2018-01-15 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: If I remember the implementation of “peek” right, it may do what you want. But the documentation doesn’t guarantee much about its behaviour; see Issue 5811. Anyway, I agree that a “getbuffn” method (or property) would be nice. (P

[issue32537] multiprocessing.pool.Pool.starmap_async - wrong parameter name

2018-01-12 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: This was supposed to be fixed in 3.6+ by Issue 31304. In general, 3.5 only gets security fixes at this stage. I’m not sure if it is easy or worth back porting this. -- nosy: +martin.

[issue32529] Call readinto in shutil.copyfileobj

2018-01-10 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Looks like you want to use a "readinto" method to reduce data copying. One problem is that it is not specified exactly what kind of object "copyfileobj" supports reading from. The documentation only sa

[issue32518] HTTPServer can't deal with persistent connection properly

2018-01-08 Thread Martin Panter
Change by Martin Panter <vadmium...@gmail.com>: -- superseder: HTTPServer can't deal with persistent connection properly -> http.server and SimpleHTTPServer hang after a few requests ___ Python tracker <rep...@bugs.python

[issue32518] HTTPServer can't deal with persistent connection properly

2018-01-08 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Perhaps this can be treated as a duplicate of Issue 31639. -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32430] Simplify Modules/Setup{,.dist,.local}

2018-01-07 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: FWIW there was documentation in the README about the Setup files, removed in Subversion r57681 (= Git revision 1c896e3). It looks like it still survives in the 2.7 version. -- nosy: +martin.

[issue25095] test_httpservers hangs since Python 3.5

2018-01-05 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Thanks, although the fact that “Content-Length: 0” doesn’t work kills my theory about the proxy. The “close_connection” flag is also a documented public API of Python: <https://docs.python.org/3/library/http.se

[issue25095] test_httpservers hangs since Python 3.5

2018-01-05 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Sorry William, I forgot the client was waiting to read. But I don’t understand why your Connection field (which comes after the status line) allows the Python client to read the status line. Perhaps there is some malware s

[issue25095] test_httpservers hangs since Python 3.5

2018-01-05 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: In the server, the send_header("Connection", "close") call sets the “close_connection” flag. This shuts down the connection once “do_GET” returns. Without the flag set, the server will wait and read ano

[issue32491] base64.decode: linebreaks are not ignored

2018-01-03 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: I wrote an incremental base-64 decoder for the "codecs" module in Issue 27799, which you could use. It just does some preprocessing using a regular expression to pick four-character chunks before passing the data to a2b_

[issue32413] Document that locals() may return globals()

2018-01-02 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: FWIW a few years ago I wrote a patch for Issue 17546 that documents three personalities of “locals”, including: * At the module level, the dictionary returned is the global symbol table, also returned by :func:`globals`. -

[issue32456] PYTHONIOENCODING=undefined doesn't work in Python 3

2018-01-02 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: My guess is there is no message because in Python 3, errors are encoded according to PYTHONIOENCODING. Perhaps it works as you expect if you bypass sys.excepthook: $ PYTHONIOENCODING=undefined python -c 'import sys, os; sys.exce

[issue32434] pathlib.WindowsPath.reslove(strict=False) returns absoulte path only if at least one component exists

2017-12-27 Thread Martin Liska
New submission from Martin Liska <jugg...@gmail.com>: The documentation for pathlib.Path.resolve says: "Make the path absolute, resolving any symlinks." On Windows, the behavior doesn't always match the first part of the statement. Example: On a system with an existing, but e

[issue32352] `inspect.getfullargspec` doesn't work fine for some builtin callable objects

2017-12-17 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: This was documented for the “getfullargspec” function in Issue 7422 (long before “signature” existed). The error message was also clarified in Issue 6905. However IMO the term “Python function” is too subtle and amb

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-12-17 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Not if the time is associated with a particular day. Imagine implementing datetime.fromisoformat by separately calling date.fromisoformat and time.fromisoformat. The date will be off by one day if you naively rounded 2017-12-18 23:

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-12-17 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Regarding Matthieu’s RFC 3339 parser, Victor wanted to use the round-half-to-even rule to get a whole number of microseconds. But considering the “time” class cannot represent 24:00, how do you round up in the extreme case past

[issue32315] can't run any scripts with 2.7.x, 32 and 64-bit

2017-12-16 Thread Martin
Martin <mdelij...@gmail.com> added the comment: I used Python on other machines, I know how it's supposed to work. I'm using Windows 7 and this problem happened with 2.7.14, 2.7.13 and 2.7.9. I didn't bother trying all other versions because it looked like it didn't matter what v

[issue32315] can't run any scripts with 2.7.x, 32 and 64-bit

2017-12-13 Thread Martin
New submission from Martin <mdelij...@gmail.com>: When I try to run a really simple script like: def fun(a): print a return I get this error: Exception in Tkinter callback Traceback (most recent call last): File "C:\Python27\lib\lib-tk\Tkinter.py", line 1541, in __c

[issue17972] inspect module docs omits many functions

2017-12-09 Thread Martin Panter
Change by Martin Panter <vadmium...@gmail.com>: -- dependencies: +Online doc does not include inspect.classify_class_attrs ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue32247] shutil-copytree: Create dst folder only if it doesn't exist

2017-12-08 Thread Martin Panter
Change by Martin Panter <vadmium...@gmail.com>: -- superseder: -> add exist_ok to shutil.copytree ___ Python tracker <rep...@bugs.python.org> <https://bugs.pyt

[issue28185] Tabs in C source code

2017-12-08 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Similar changes were made in Issue 32150 and PR 3892 (tabs) and Mercurial revision 98d1788c905c (trailing space and indentation). All the other tabs in these patches appear to have been removed with other work: #29524, #31891,

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-12-04 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: The other difference is Mattieu guarantees ValueError for invalid input strings, which I think is good. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue15873] datetime: add ability to parse RFC 3339 dates and times

2017-12-04 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: P-ganssle seems to be proposing to limit parsing to exactly what “datetime.isoformat” produces; i.e. whole number of seconds, milliseconds or microseconds. Personally I would prefer it without this limitation, like in Mathieu’s p

[issue29710] Incorrect representation caveat on bitwise operation docs

2017-12-02 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: FWIW I find Mark’s suggestion pretty good: “Each bitwise operation has the same result as though carried out in two's complement using a bit-width that's large enough to represent the

[issue25054] Capturing start of line '^'

2017-12-02 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: The new “finditer” behaviour seems to contradict the documentation about excluding empty matches if they touch the start of another match. >>> list(re.finditer(r"\b|:+", "a::bc")) [, , , , ] An empty m

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

2017-12-01 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Michael Felt: if you still want the code compatible with Python 2 and 3 (and others are happy with that), I suggest documenting that in a code comment. -- ___ Python tracke

[issue32085] [Security] A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages!

2017-12-01 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Issue 32185 proposes to stop sending IP addresses in the TLS SNI protocol. Maybe this will help; it depends if it will catch IP address strings with with whitespace or if there are other ways to inject invalid hos

[issue16487] Allow ssl certificates to be specified from memory rather than files.

2017-11-30 Thread Martin Richard
Martin Richard <mart...@martiusweb.net> added the comment: FWIW, PyOpenSSL allows to load certificates and keys from a memory buffer and much more. It's also fairly easy to switch from ssl to PyOpenSSL. It's probably a viable alternative in many

[issue32143] os.statvfs lacks f_fsid

2017-11-26 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: The doc string for the result object, and the main Python 2 documentation, both say that the result is a 10-tuple. So perhaps any new field should only be an attribute, and the tuple should stay the same size, to maintain compati

[issue10231] SimpleHTTPRequestHandler directory bugs

2017-11-25 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: I read in PEP 11 that Mac OS 9 support was dropped in Python 2.4. I agree that eliminating “.” and “..” components makes sense, since that is how they should be handled when resolving relative URLs. But it seems low priority,

[issue32084] [Security] http.server can be abused to redirect to (almost) arbitrary URL

2017-11-25 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Maybe a good fix would be to “escape” the double slash with “/.”: if os.path.isdir(path): url = self.path if url.startswith('//'): # E.g. "//www.python.org/%2f.." url = "/." + url # Becom

[issue10231] SimpleHTTPRequestHandler directory bugs

2017-11-25 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: The first two bugs ("foo/dir?baz" and "foo/dir?baz/") were solved by Issue 23112. The third (".../foo.html/") was solved by Issue 17324. That leaves the fourth complaint, which I don’t understand

[issue30458] CRLF Injection in httplib

2017-11-25 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Actually, the CRLF + space can be injected via percent encoding, so just dealing with literal CRLFs and spaces wouldn’t be enough. You would have to validate the hostname after it is decoded. urlopen("http://127.0.0.1%0D%0

[issue32085] [Security] A New Era of SSRF - Exploiting URL Parser in Trending Programming Languages!

2017-11-25 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: The square □ in the strings represents a space. Issue 1 (CRLF in HTTP request path): it looks like the %0D%0A would have to be decoded by an earlier step in the chain to "http://127.0.0.1:25/\r\nHELO . . .". This becomes

[issue30458] CRLF Injection in httplib

2017-11-25 Thread Martin Panter
Change by Martin Panter <vadmium...@gmail.com>: -- type: -> security ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue30458> ___ __

[issue32135] Dict creation with update will result to NoneType

2017-11-25 Thread Martin
New submission from Martin <martin.bend...@gmail.com>: >>> x = {"x":123}.update({"abc":123}) >>> type(x) -- messages: 306977 nosy: thedemz priority: normal severity: normal status: open title: Dict creation with update will result to

[issue28778] wsgiref HTTP Response Header Injection: CRLF Injection

2017-11-25 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Issue 11671 is closely related and has a patch proposing to ban control characters including CRLF (but not spaces). Also see Issue 22928 which added header field validation to the HTTP client module. -- dependencies: +Se

[issue19613] test_nntplib: sporadic failures, test_article_head_body()

2017-11-24 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Victor opened Issue 32128 with the same complaint. I think I found the offending article: >>> server = NNTP_SSL("nntp.aioe.org") >>> [response, count, first, last, name] = server.group("comp.l

[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-11-24 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: If it helps, here is a basic test case I wrote for “pty.spawn”. I hope that it exposes the problem on Free BSD, but I have only tested it on Linux. parent = r'''\ import pty, sys pty.spawn((sys.executable, "-c", sys.arg

[issue32028] Syntactically wrong suggestions by the new custom print statement error message

2017-11-14 Thread Martin Drawitsch
New submission from Martin Drawitsch <martin.drawit...@gmail.com>: I think I found a bug in the new print syntax suggestion introduced by https://bugs.python.org/issue30597. When the following code is executed by Python 3.6.3 inside of a .py file: def f(): print '%

[issue32009] seg fault when using Cntrl-q keymap to exit app

2017-11-11 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: This looks the same as Issue 25259. The trigger is that multiple lines are generated at the same time, but Python only expects the first line. -- nosy: +martin.panter resolution: -> duplicate stage: -> resolved

[issue31526] Allow setting timestamp in gzip-compressed tarfiles

2017-11-10 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Perhaps you can compress the tar file using the “gzip.GzipFile” class. It accepts a custom “mtime” parameter (see Issue 4272, added in 2.7 and 3.1+): >>> gztar = BytesIO() >>> tar = GzipFile(fileobj=

[issue31959] Directory at `TemporaryDirectory().name` does not exist

2017-11-06 Thread Martin Panter
Change by Martin Panter <vadmium...@gmail.com>: -- nosy: +serhiy.storchaka resolution: wont fix -> not a bug stage: -> resolved ___ Python tracker <rep...@bugs.python.org> <https://bugs.

[issue31959] Directory at `TemporaryDirectory().name` does not exist

2017-11-06 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: The documentation says “On . . . destruction of the temporary directory object the newly created temporary directory and all its contents are removed”. If you had enabled warnings, you may have seen a hint: $ python -Wdefault -c '

[issue25942] subprocess.call SIGKILLs too liberally

2017-11-05 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: https://github.com/python/cpython/pull/4283 adds a secondary timeout, which defaults to 1 s when there is no main timeout. But this seems complicated and arbitrary. As I understand, the main use case discussed here was waiting w

[issue29710] Incorrect representation caveat on bitwise operation docs

2017-11-05 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: I find the model in terms of “bit_length” hard to understand. You have to understand what bit_length returns, and why you added 1. Bit_length is awkward for negative numbers. It only uses the absolute value, which would give off-

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

2017-11-05 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Issue 31945 proposes adding a “blocksize” parameter to HTTPConnection objects, so I suggest to closing in favour of that one. -- resolution: -> rejected superseder: -> Configurable blocksize in HTTP(

[issue31935] subprocess.run() timeout not working with grandchildren and stdout=PIPE

2017-11-03 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: This proposal sounds like a race condition. Closing the output pipe as a child exits means you risk missing recent output. On the other hand, if you don’t care about the output any more, close the pipe first and then wait for the

[issue31935] subprocess.run() timeout not working with grandchildren and stdout=PIPE

2017-11-03 Thread Martin Ritter
New submission from Martin Ritter <mce.rit...@gmail.com>: Hi, I tried to use subprocess.run(..., stdout=subprocess.PIPE, timeout=N) to run some test scripts with a given timeout. This works as expected with simple scripts. However if the script itself creates other children

[issue31894] test_timestamp_naive failed on NetBSD

2017-10-29 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Are you sure it is a “system” bug? As far as I understand, at least Posix does not require support for local time before 1970. See <http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap04.html#tag_04_16>. But why

[issue31749] Request: Human readable byte amounts in the standard library

2017-10-29 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Ken Kundert started a related discussion a while back on Python-ideas: <https://www.mail-archive.com/search?l=mid=20160830203427.ge2...@kundert.designers-guide.com>. This was about SI-prefixed units in general; not restric

[issue22671] Typo in class io.BufferedIOBase docs

2017-10-28 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: I’m unlikely to soon, but I don’t mind if someone else uses my patch. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue24291] Many servers (wsgiref, http.server, etc) can truncate large output blobs

2017-10-27 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Closing because I understand it is too late to do anything for 3.5 now. -- resolution: -> out of date stage: patch review -> resolved status: open -> closed ___ Pyth

[issue18670] Using read_mime_types function from mimetypes module gives resource warning

2017-10-27 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: The patches would mask an OSError raised by the “readfp” call, which would be a change in behaviour. But moving the call does not seem to be necessary; why not leave it outside the “try” statement? -- nosy: +martin.

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: FWIW it looks like “strptime” in glibc, and Open and Free BSD support parsing this and even more formats (RFC 822 and RFC 3339; includes “Z”, U.S. time zones, ±HH). Also, there is Issue 24954 for adding “%:z” like Gnu

[issue31800] datetime.strptime: Support for parsing offsets with a colon

2017-10-16 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Sorry, I meant Net BSD not Free BSD -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue31760] Re-definition of _POSIX_C_SOURCE with Fedora 26.

2017-10-16 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Looks the same as Issue 31374 -- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> expat: warning: "_POSIX_C_SOURCE" redefined __

[issue31712] subprocess with stderr=subprocess.STDOUT hang

2017-10-07 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Scanning over the Open SSH commits for 7.3p1 https://github.com/openssh/openssh-portable/compare/V_7_2_P2...V_7_3_P1 it looks like this commit https://github.com/openssh/openssh-portable/commit/d2d6bf864e52af8491a60dd507f85b7436

[issue31712] subprocess with stderr=subprocess.STDOUT hang

2017-10-06 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Presumuing your file descriptor 3 is the read end of the pipe to the child’s output, then there is probably a process somewhere that could still write to the write end. Normally “check_output” waits until it has read all possible

[issue31656] Bitwise operations for bytes-type

2017-10-01 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: There’s already a bug open for this: Issue 19251. Only equal-length strings should be supported. -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <https://

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-09-30 Thread Martin Panter
Change by Martin Panter <vadmium...@gmail.com>: -- Removed message: https://bugs.python.org/msg303440 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-09-30 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: . Actually take back a lot of what I wrote above. I forgot that SimpleHTTPRequestHandler only supports HTTP 1.0; I don’t think it uses keep-alive or persistent connections, so it should close its TCP connections promptly. The

[issue31639] http.server and SimpleHTTPServer hang after a few requests

2017-09-30 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: The change in handling KeyboardInterrupt was my intention in Issue 23430. I hope it isn’t a problem on its own :) Running the module with “python -m http.server” uses the HTTPServer class, based on socketserver.TCPServer. Thi

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

2017-09-30 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: I prefer Cornelius’s current proposal (rev 4f8137b) because it fixes both sites, rather than just patching the immediate problem site. I don’t think read(1) is a big problem, just less efficient. But if you prefer to do larger

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

2017-09-29 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Regarding the compressed data generator, it would be better if there were no restrictions on the generator yielding empty chunks. This would match how the upload “body” parameter for HTTPConnection.request can be an iterator w

[issue31520] ResourceWarning: unclosed warning

2017-09-25 Thread Martin Panter
Martin Panter added the comment: I’m curious how you manage to trigger the warning in the “closed” state. The Python I have handy is half a year out of date, but all my attempts to trigger the warning either produce the less confusing version, ResourceWarning: unclosed

[issue31351] ensurepip discards pip's return code which leads to broken venvs

2017-09-19 Thread Martin Vielsmaier
Martin Vielsmaier added the comment: I guess this is also the root cause for the problem I reported on virtualenv: https://github.com/pypa/virtualenv/issues/1074 -- nosy: +Martin Vielsmaier ___ Python tracker <rep...@bugs.python.org>

[issue31504] Documentation for return value for string.rindex is missing when search string is empty

2017-09-18 Thread Martin Panter
Martin Panter added the comment: The behaviour for searching for empty strings in Python is inconsistent; see Issue 24243. IMO the behaviour for the (r)find/index methods is sensible, but it is worth making the documentation explicit. The returned indexes you have given (5, 1, and 0

[issue31487] Improve f-strings documentation wrt format specifiers

2017-09-17 Thread Martin Panter
Martin Panter added the comment: >>> f"{number:#0x}" # using integer format specifier It’s not clear what your purpose was adding the above line, but the zero flag (0) does nothing because there is no “width” field. I think it could be misleading, because it is actu

[issue31495] Wrong offset with IndentationError ("expected an indented block")

2017-09-16 Thread Martin Panter
Martin Panter added the comment: Some relevant info I wrote in Issue 25677: ‘The caret points to the character _before_ offset. . . . In some cases (e.g. the line “1 +”), the offset is the string index _after_ the error. But in the case of “1;1 + 1 = 2”, offset is the index where the error

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

2017-09-13 Thread Martin Panter
Martin Panter added the comment: . Isn’t your use of “cmd” similar enough to shell=True? I.e. isn’t that a “cmd” parent process spawning a “waitfor” child? If your 4 s “subprocess.run” call times out, does it kill the “waitfor” process, or leave it running? Could the “waitfor” process write

[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

[issue28287] Refactor subprocess.Popen to let a subclass handle IO asynchronously

2017-08-25 Thread Martin Richard
Martin Richard added the comment: Yes, the goal is to isolate the blocking IO in __init__ into other methods so Popen can be subclassed in asyncio. The end goal is to ensure that when asyncio calls Popen(), it doesn't block the process. In the context of asyncio, there's no need to make Popen

[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

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