[issue33342] urllib IPv6 parsing fails with special characters in passwords

2018-05-19 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: I presume this is about parsing a URL like >>> urlsplit("//user:[@host") Traceback (most recent call last): File "", line 1, in File "/home/proj/python/cpython/Lib/urllib/parse.py", line 4

[issue20941] pytime.c:184 and pytime.c:218: runtime error, outside the range of representable values of type 'long'

2018-05-18 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: I don’t know; I haven’t tested it. I was anticipating that it is fixed, but perhaps I should leave the resolution alone instead? -- ___ Python tracker <rep...@bugs.python.or

[issue20941] pytime.c:184 and pytime.c:218: runtime error, outside the range of representable values of type 'long'

2018-05-18 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Maybe worth checking if this is fixed due to the changes in Issue 31373 for 3.6+. -- nosy: +martin.panter resolution: -> out of date superseder: -> demoting floating float values to unrepresentable types is undefi

[issue33321] Add a Linux clang ubsan undefined behavior sanitizer buildbot

2018-05-18 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Perhaps your “ctypes” problems may be helped by my ctypes_v2.patch in Issue 1621. Or perhaps they are already documented in Issue 15119 and/or Issue 28169. -- nosy: +martin.panter ___

[issue1621] Do not assume signed integer overflow behavior

2018-05-18 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Sorry I haven’t made a PR for ctypes_v2.patch, but I don’t mind if someone else takes over. I understand the HAVE_LONG_LONG check may no longer necessary for newer Python ve

[issue12486] tokenize module should have a unicode API

2018-05-18 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Don’t forget about updating __all__. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue33341] python3 fails to build if directory or sysroot contains "*icc*" string

2018-05-17 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Maybe this is the same as Issue 28584, about the ${CC} variable rather than “sysroot”. In any case, the patch looks unrelated. -- nosy: +martin.panter ___ Python tracker <rep...@bugs.p

[issue33481] configparser.write() does not save comments.

2018-05-14 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Looks like Issue 1410680 has a new function to merge comments with new config values (among other things). -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.or

[issue32393] nav menu jitter in old documentation

2018-05-14 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Maybe related to Issue 24712? -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue20104] expose posix_spawn(p)

2018-05-14 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: I suggested the “scheduler” tuple to bring the two related parameters (scheduling policy and sched_param) together, similar to how they are paired as the second and third parameters to “os.sched_setscheduler”, and because I t

[issue20104] expose posix_spawn(p)

2018-05-06 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Can you use the existing sched_param class? https://docs.python.org/3/library/os.html#os.sched_param -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python

[issue20104] expose posix_spawn(p)

2018-05-06 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: To wrap “posix_spawnattr_setschedparam” perhaps you could combine it with the scheduler policy: # Inherit current policy and parameters: posix_spawn(..., scheduler=None) # Set new policy with parameters: posix_spawn(..., sch

[issue33411] All console message are in the error output in bash interpretor

2018-05-05 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: The exception message and stack trace is documented to go to stderr: <https://docs.python.org/2/library/sys.html#sys.excepthook>. Whether the prompt “>>>” goes to stderr or stdout depends on quirks of the en

[issue28627] [alpine] shutil.copytree fail to copy a direcotry with broken symlinks

2018-04-20 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: This looks like it may be covered by Issue 31940, about the “shutil.copystat” API. See Anthony’s initial proposal at <https://bugs.python.org/issue31940#msg305528>. Max: I think you need the “else” branch to reraise t

[issue33300] Bad usage example in id() DocString

2018-04-17 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: It is supposed to be a function signature, similar to the syntax when you define your own function, rather than a usage example of calling the function. In this case, the slash notation is described by PEP 457. It is supposed to in

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-04-04 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Sorry, I realize there is a problem remaining with the pointer types for "Noddy_name" (Noddy vs PyObject pointers), so you can't remove the cast there. But my suggestion should still apply to other places, for instance

[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-04-01 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Siddhesh, it looks like your fixes make the C function signatures match the signature expected in the PyMethodDef structure. If so, I suggest to remove the (PyCFunction) casts from those structure definitions as well. For instanc

[issue22781] ctypes: Differing results between Python and C.

2018-04-01 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Eryk Sun’s explanation makes this sound like a duplicate of Issue 15453, which shows GCC on Linux packing structures into a single byte, and ctypes using the size of the expanded integer type. -- nosy: +martin.panter reso

[issue33079] subprocess: document the interaction between subprocess.Popen and os.set_inheritable

2018-03-25 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: There is no “open_fds” parameter as far as I know. I presume you meant heritable descriptors are still closed with close_fds=True (not open_fds=False). Are you sure about the second part? In my experiments on Linux, unless

[issue31823] Opaque default value for close_fds argument in Popen.__init__

2018-03-25 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: The close_fds= in that signature seems fine to me. If you read the documentation, it says the default mode depends on the platform, and on other parameters. However I think the signature at <https://docs.python.org/release/3.6.

[issue32270] subprocess closes redirected fds even if they are in pass_fds

2018-03-25 Thread Martin Panter
Change by Martin Panter <vadmium...@gmail.com>: -- nosy: +martin.panter ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32270> ___

[issue27069] webbrowser creates zombi processes in the background mode

2018-03-17 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: It does look similar. They probably could be merged. The main difference is in Issue 5993 Eivind suggested to somehow use a “wait” system call, while here Victor suggested “fork” (perhaps to orphan a grandchild p

[issue33062] ssl_renegotiate() doesn't seem to be exposed

2018-03-13 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: I have also wanted to force renegotation for testing with Python. As a workaround, I have used the "openssl s_server" program, which I described at <https://bugs.python.org/issue25919#msg257508> (use the lower-ca

[issue32993] urllib and webbrowser.open() can open w/ file: protocol

2018-03-11 Thread Martin Panter
Martin Panter <vadmium...@gmail.com> added the comment: Hi Yao, I tend to agree with Ned. The support for “file:” URLs is by design. I don’t see any security problems. I suggest to close this. In Issue 11662, it was decided that a web server redirecting to a “file:” URL was a security p

[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

[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

[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

[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

[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

[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> ___ __

[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

[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

[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

[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

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