[issue33017] Special set-cookie setting will bypass Cookielib

2019-04-25 Thread Martin Panter
Martin Panter added the comment: I think LCatro is saying that Python should accept the cookies and discard only the offending attributes. This makes sense to me and tends to agree with the specifications, but the three cases seem all seem unimportant to me. PoC 1, Max-age: >>> fro

[issue12144] cookielib.CookieJar.make_cookies fails for cookies with 'expires' set

2019-04-25 Thread Martin Panter
Martin Panter added the comment: Karthikeyan, it looks like your test will pass even when the bug is not fixed. A test calling code that writes error message does not necessarily mean the test itself will fail, I don’t think. I suggest you look at raising an exception when the UserWarning is

[issue1564508] RFC 2965 BaseCookie does not support "$Port"

2019-04-24 Thread Martin Panter
Martin Panter added the comment: The original report comes from <https://code.djangoproject.com/ticket/2806>. Anders was trying to parse a HTTP request Cookie field, something like: BaseCookie('sessionid=a2be2e7debe71af8d88d350c4d14d768;$Path=/;$Domain=192.168.0.2;$Port="8000

[issue23930] http.cookies.SimpleCookie doesn't parse comma-only separated cookies correctly

2019-04-24 Thread Martin Panter
Change by Martin Panter : -- resolution: -> rejected status: open -> pending ___ Python tracker <https://bugs.python.org/issue23930> ___ ___ Python-bugs-

[issue23298] Add ArgumentParser.add_mutually_dependence_group

2019-04-24 Thread Martin Panter
Change by Martin Panter : -- superseder: -> Add "necessarily inclusive" groups to argparse ___ Python tracker <https://bugs.python.org/issue23298> ___

[issue22742] IDLE shows traceback when printing non-BMP character

2019-04-24 Thread Martin Panter
Martin Panter added the comment: I haven’t looked at the code, but I suspect Idle implements a custom “sys.displayhook”: >>> help(sys.displayhook) Help on function displayhook in module idlelib.rpc: displayhook(value) Override standard display hook to use non-locale

[issue36711] duplicate method definition in Lib/email/feedparser.py

2019-04-24 Thread Martin Panter
Martin Panter added the comment: This is caused by Serhiy’s first change to 2.7 in Issue 21448. Compare Mercurial rev. 1b1f92e39462 (3.4 branch) with ba90bd01c5f1 (2.7). In 2.7, he applied the Python 3 version of the code, which used “str.splitlines” rather than a regular expression

[issue36701] module 'urllib' has no attribute 'request'

2019-04-23 Thread Martin Panter
Martin Panter added the comment: The “urllib” package also contains “urllib.parse”, which is a lot more lightweight than “urllib.request”. In a quick experiment, importing “urllib.request” is more than 2 times slower than importing “urllib.parse” on its own. And importing “urllib” by itself

[issue33632] undefined behaviour: signed integer overflow in threadmodule.c

2019-04-13 Thread Martin Panter
Martin Panter added the comment: Victor, if you run the test suite, one of the test cases should trigger the overflow. I used to compile with Undefined Behaviour Sanitizer to print messages when these errors occur; see <https://bugs.python.org/issue1621#msg271118> for my setup at the t

[issue17267] datetime.time support for '+' and '-'

2019-04-13 Thread Martin Panter
Martin Panter added the comment: A real use case that I have had was with a protocol to activate a device with a daily schedule. The protocol takes start and end hours and minutes of the day. To test the device by activating it over the next few minutes, my ideal way would have taken the

[issue36600] re-enable test in nntplib

2019-04-12 Thread Martin Panter
Martin Panter added the comment: Does the test still depend on real-world posts? If so, see Issue 19613. I don’t think the problem has been fixed. -- nosy: +martin.panter superseder: -> test_nntplib: sporadic failures, test_article_head_b

[issue30458] [security][CVE-2019-9740][CVE-2019-9947] HTTP Header Injection (follow-up of CVE-2016-5699)

2019-04-10 Thread Martin Panter
Martin Panter added the comment: Gregory, I haven’t tried recent Python code, but I expect the problem with percent decoding is still there. If you did try my example, what results did you see? Be aware that these techniques only work if the OS co-operates and connects to localhost when you

[issue36293] Nonblocking read sys.stdin raises error

2019-03-30 Thread Martin Panter
Change by Martin Panter : -- resolution: -> duplicate ___ Python tracker <https://bugs.python.org/issue36293> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue36293] Nonblocking read sys.stdin raises error

2019-03-30 Thread Martin Panter
Martin Panter added the comment: I wasn’t sure about closing it, in case Cyker came back with more details. E.g. what was the use case? Were they mislead by the documentation? Do they just think the error should be different, or do they think there should be no error in this case? But I

[issue35403] support application/wasm in mimetypes and http.server

2019-03-30 Thread Martin Panter
Change by Martin Panter : -- superseder: -> http.server module sets incorrect mimetype for WebAssembly files ___ Python tracker <https://bugs.python.org/issu

[issue35403] support application/wasm in mimetypes and http.server

2019-03-30 Thread Martin Panter
Martin Panter added the comment: According to Issue 34758, this was already added to 3.8’s “mimetypes”. -- nosy: +martin.panter resolution: -> out of date stage: -> resolved status: open -> closed ___ Python tracker <https://bug

[issue36483] Missing line in documentation example

2019-03-30 Thread Martin Panter
Martin Panter added the comment: Did you read the bracketed paragraph directly below, or try running the code with your “break” statement? I expect it would stop at the first prime number (two). But the output continues with more prime numbers. -- nosy: +martin.panter resolution

[issue36464] Python 2.7 build install fails intermittently with -j on MacOS

2019-03-30 Thread Martin Panter
Martin Panter added the comment: On Linux, Gnu’s “install” command is happy if the target directory already exists; it just changes the mode (-m) etc. So the race isn’t a big deal. This is like the race I described (theoretical at the time) at <https://bugs.python.org/issue25696#msg255

[issue33319] `subprocess.run` documentation doesn't tell is using `stdout=PIPE` safe

2019-03-22 Thread Martin Panter
Martin Panter added the comment: This is a regression in the 3.7+ documentation. It previously said “To [capture output], pass PIPE for the ‘stdout’ and/or ‘stderr’ arguments”. This was removed by Bo Bayles in Issue 32102. -- keywords: +3.7regression nosy: +bbayles, gregory.p.smith

[issue36304] When using bz2 and lzma in mode 'wt', the BOM is not written

2019-03-15 Thread Martin Panter
Martin Panter added the comment: I suspect this is caused by TextIOWrapper guessing if it is writing the start of a file versus in the middle, and being confused by “seekable” returning False. GzipFile implements some “seek” calls in write mode, but LZMAFile and BZ2File do not. Using this

[issue36300] eval of generator expressions cannot access local variables

2019-03-15 Thread Martin Hosken
Change by Martin Hosken : -- versions: +Python 3.6 ___ Python tracker <https://bugs.python.org/issue36300> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36300] eval of generator expressions cannot access local variables

2019-03-15 Thread Martin Hosken
New submission from Martin Hosken : The following code fails: >>> lcls = {'w': 100} >>> eval('[w for x in ("hello", "world")]', None, lcls) Traceback (most recent call last): File "", line 1, in File &

[issue36294] `io.BufferedIOBase` returns `None`

2019-03-15 Thread Martin Panter
Martin Panter added the comment: The general problem of non-blocking reads with BufferedIOBase is covered by Issue 13322. The documentation and implementations do not agree. I suggest to not rely on any particular behaviour reading BufferedIOBase objects in non-blocking mode. The problem of

[issue36293] Nonblocking read sys.stdin raises error

2019-03-15 Thread Martin Panter
Martin Panter added the comment: This is the same story as in Issue 35762. Both “sys.stdin” and “subprocess.Popen.stderr” (when universal_newlines=True is enabled) use the TextIOWrapper class, which I don’t think was implemented with non-blocking mode in mind. Issue 24560 is similar, but is

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

2019-03-15 Thread Martin Panter
Change by Martin Panter : -- stage: -> resolved status: pending -> closed ___ Python tracker <https://bugs.python.org/issue25476> ___ ___ Python-bugs-list

[issue36246] csv.writer lineterminator affects csv escaping

2019-03-08 Thread Martin Panter
Martin Panter added the comment: This is the result that I see: >>> output = StringIO() >>> csv.writer(output, lineterminator='\n').writerow(["Whoa!\rNewlines!"]) 16 >>> output.getvalue() 'Whoa!\rNewlines!\n' For comparison, this is th

[issue36226] multipart/related header causes false positive StartBoundaryNotFoundDefect and MultipartInvariantViolationDefect

2019-03-07 Thread Martin Panter
Martin Panter added the comment: Probably the same as Issue 29353. I remember than enabling "headersonly" can create inconsistencies in the message object. But I don't remember the details. According to Issue 29991 (another duplicate), my patch for Issue 24363 might help. Bu

[issue29167] Race condition in enum.py:_decompose()

2019-03-04 Thread Martin
Martin added the comment: Our production system hit this issue using Python 3.6.7 once a few days ago, so presumably the race is still possible with the applied patch, just less likely? ``` RuntimeError: dictionary changed size during iteration at _decompose (/usr/lib/python3.6/enum.py:858

[issue36172] csv module internal consistency

2019-03-03 Thread Martin Panter
Martin Panter added the comment: The documentation <https://docs.python.org/dev/library/csv.html#module-contents> says you should “open the files with newline=''.” IMO this is an unfortunate quirk of the CSV module. Everything else that I know of in the Python built-in libra

[issue36161] Use thread-safe functions instead of unsafe ones (crypt, ttyname)

2019-03-01 Thread Martin Panter
Martin Panter added the comment: In Issue 28503, “crypt_r” was added to Python 3.7 and 3.8+, and it looks like it is still there. Regarding error handling for “crypt”, it is not documented, but the Python function returns None on error. You would have to consider backwards compatibility to

[issue36050] Why does http.client.HTTPResponse._safe_read use MAXAMOUNT

2019-02-24 Thread Martin Panter
Martin Panter added the comment: The 1 MiB limit was added for Issue 1296004; apparently some platforms were overallocating multiple buffers and running out of memory. I suspect the loop in "_safe_read" was inherited from Python 2, which has different kinds of file objects. Th

[issue36064] docs: urllib.request.Request not accepting iterables data type

2019-02-22 Thread Martin Panter
Martin Panter added the comment: I agree the documentation is insufficient. It should have said if “data” is iterated, it must yield bytes-like objects. I agree it is unwise to yet more special cases for the uploaded data types. When Lye passed the dictionary of three keys and values, I

[issue31162] urllib.request.urlopen CERTIFICATE_VERIFY_FAILED error

2019-02-22 Thread Martin Panter
Change by Martin Panter : -- resolution: -> not a bug status: open -> pending title: urllib.request.urlopen error -> urllib.request.urlopen CERTIFICATE_VERIFY_FAILED error ___ Python tracker <https://bugs.python.or

[issue22865] Document how to make pty.spawn not copy data

2019-02-21 Thread Martin Panter
Martin Panter added the comment: I'm not sure it is wise for the Python documentation to suggest inserting null bytes in general. This seems more like an application-specific hack. There is nothing in Python that handles these null bytes specially, and I expect they will be seen i

[issue34785] pty.spawn -- auto-termination after child process is dead (a zombie)

2019-02-21 Thread Martin Panter
Martin Panter added the comment: Suggest closing this assuming it is a duplicate, unless Jarry can give more information. -- resolution: -> duplicate status: open -> pending superseder: -> pty.spawn hangs on FreeBSD 9.3, 10.x ___ Pytho

[issue5038] urrlib2/httplib doesn't reset file position between requests

2019-02-15 Thread Martin Panter
Martin Panter added the comment: For 3.7+ (where iterable objects are supported), I suggest: 1. Document the problem as a limitation of handlers like AbstractBasicAuthHandler, and consider raising an exception instead of trying to upload a file or iterable a second time. 2. Clarify the

[issue22347] mimetypes.guess_type("//example.com") misinterprets host name as file name

2019-02-08 Thread Martin Panter
Change by Martin Panter : -- dependencies: +Remove urllib.parse._splittype from mimetypes.guess_type ___ Python tracker <https://bugs.python.org/issue22

[issue25862] TextIOWrapper assertion failure after read() and SEEK_CUR

2019-02-08 Thread Martin Panter
Martin Panter added the comment: I haven’t confirmed, but it looks like the original change here broke bidirectional reading and writing with a single TextIOWrapper object; see Issue 35928. -- ___ Python tracker <https://bugs.python.

[issue35928] socket makefile read-write discards received data

2019-02-08 Thread Martin Panter
Martin Panter added the comment: Looking over the changelog, my guess (untested) is this is caused by commit d6a283b3 for Issue 25862. That change looks like it drops the internal TextIOWrapper decoding buffer for each successful write. I don't have the right version of Python to test

[issue35906] Header Injection in urllib

2019-02-06 Thread Martin Panter
Martin Panter added the comment: Maybe related to Victor's "Issue 1" described in Issue 32085. That is also a security bug about CRLF in the URL's path, but was opened before Issue 30500 was opened and the code changed, so I'm not sure if it is the same as this or

[issue35869] io.BufferReader.read() returns None

2019-02-01 Thread Martin Panter
Martin Panter added the comment: This is covered by Issue 13322. There are a few other BufferedReader methods that contradict the documentation for non-blocking mode. A while ago I posted a patch to change the implementation to match the documentation, but nobody reviewed it or gave their

[issue35870] readline() specification is unclear

2019-01-31 Thread Martin Panter
Martin Panter added the comment: I agree that the documentation should be clearer about the first two points. Considering that the "input" function and by default the "str.splitlines" method both behave differently, I often had to re-learn this when I had less Pyt

[issue35848] readinto is not a method on io.TextIOBase

2019-01-30 Thread Martin Panter
Martin Panter added the comment: I think it would be more practical to fix the documentation (option 1). Do you have a use case for “TextIOBase.readinto” raising ValueError (something more concrete than someone having expectations)? -- nosy: +martin.panter

[issue31456] SimpleCookie fails to parse any cookie if an entry has whitespace in the name

2019-01-26 Thread Martin Panter
Martin Panter added the comment: The main cause of this behaviour is that whitespace (matching the ASCII RE “\s”) is treated as separation between cookie “morsels”. It looks like this has always been the behaviour, but I’m not sure it was intended. >>> print(BaseCookie('first

[issue2212] Cookie.BaseCookie has ambiguous unicode handling

2019-01-26 Thread Martin Panter
Change by Martin Panter : -- stage: test needed -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue2212> ___ ___ Pyth

[issue2212] Cookie.BaseCookie has ambiguous unicode handling

2019-01-26 Thread Martin Panter
Martin Panter added the comment: Same as Issue 11315, where Éric suggested documenting the behaviour. -- nosy: +martin.panter resolution: -> duplicate superseder: -> unicode support in Cookie module ___ Python tracker <https://bugs.p

[issue11315] unicode support in Cookie module

2019-01-26 Thread Martin Panter
Martin Panter added the comment: Sorry, but changing to bytes after ten years of using str in this module in Python 3 is not going to happen. Let’s just document the state of Python 2 (see Éric: https://bugs.python.org/issue11315#msg129448). -- assignee: -> docs@python compone

[issue19670] SimpleCookie Generates Non-RFC6265-Compliant Cookies

2019-01-26 Thread Martin Panter
Martin Panter added the comment: I think the solution here is to document what “SimpleCookie.value_encode” really does: RFC 2109 quoted-string escaping. If you want to a generate RFC-6265-compliant Set-Cookie string, do not include non-compliant characters in the cookie value, and consider

[issue35833] Backspace not working

2019-01-26 Thread Martin Panter
Martin Panter added the comment: Ment to point to previous bug report: Issue 23220 -- ___ Python tracker <https://bugs.python.org/issue35833> ___ ___ Python-bug

[issue35833] Backspace not working

2019-01-26 Thread Martin Panter
Martin Panter added the comment: I suspect Idle just passes control characters directly to an underlying Text or similar TK widget. As far as I know, TK only documents behaviour for tabs and newlines, not other control characters. Last time this was brought up, Terry added a sentence under

[issue35824] http.cookies._CookiePattern modifying regular expressions

2019-01-26 Thread Martin Panter
Martin Panter added the comment: I presume MeiK wants to use BaseCookie to parse the Set-Cookie header field, as in >>> BaseCookie('Hello=World; Expires=Thu, 31 Jan 2019 05:56:00 GMT;') >>> BaseCookie('Hello=World; Expires=Thu,31 Jan 2019 05:56:00 GMT;')

[issue23930] http.cookies.SimpleCookie doesn't parse comma-only separated cookies correctly

2019-01-26 Thread Martin Panter
Martin Panter added the comment: I think making a comma start a new cookie is dangerous, and perhaps this proposal should be rejected. I’m not an expert on web programming, but this reminds me of some security problems that already affected Python: <https://translate.google.com/translat

[issue35762] subprocess.Popen with universal_newlines and nonblocking streams fails with "can't concat NoneType to bytes"

2019-01-18 Thread Martin Panter
Martin Panter added the comment: Yes, universal newlines mode uses the TextIOWrapper class to read the pipe, which isn’t really designed for non-blocking mode. This is the same problem described by Izbyshev at <https://bugs.python.org/issue13322#msg307763>. Raising TypeError isn’t idea

[issue13322] buffered read() and write() does not raise BlockingIOError

2019-01-18 Thread Martin Panter
Martin Panter added the comment: Issue 35762 was opened specifically about Izbyshev’s case: TextIOWrapper behaviour with a non-blocking file. Calling “os.fdopen” with mode='r' (text mode) returns a TextIOWrapper object. -- ___ Pyth

[issue35748] urlparse library detecting wrong hostname leads to open redirect vulnerability

2019-01-18 Thread Martin Panter
Martin Panter added the comment: The “urllib.parse” module generally follows RFC 3986, which does not allow a literal backslash in the “userinfo” part: userinfo = *( unreserved / pct-encoded / sub-delims / ":" ) unreserved = ALPHA / DIGIT / "-" / "." / &quo

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

2019-01-18 Thread Martin Panter
Martin Panter added the comment: Today I read RFC 3986, and I think the URLs in the bug reports are valid, and are already parsed correctly. The path is allowed to have a literal “at” symbol: path-abempty = *( "/" segment ) segment = *pchar pchar = unreserved / pct-encoded /

[issue35748] urlparse library detecting wrong hostname leads to open redirect vulnerability

2019-01-16 Thread Martin Panter
Martin Panter added the comment: FWIW I understand the backslash should be percent-encoded in URLs, otherwise the URL is not valid. This reminds me of a few other bugs: * Issue 30500: Made the behaviour of fragment (#. . .) versus userinfo (. . .@) consistent, e.g. in //www.google.com

[issue35483] tarfile.extractall on existing symlink in Ubuntu overwrites target file, not symlink, unlinke GNU tar

2019-01-06 Thread Martin Panter
Change by Martin Panter : -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue35483> ___ ___

[issue19974] tarfile doesn't overwrite symlink by directory

2019-01-06 Thread Martin Panter
Martin Panter added the comment: About “lexists”, I meant using it instead of “os.path.exits” (not “islink”). On Linux: >>> targetpath = 'target' >>> os.symlink('nonexistant', dst=targetpath) # Make a broken symlink >>> os.system('ls -l&#x

[issue35649] http.client doesn't close. Infinite loop

2019-01-03 Thread Martin Panter
Martin Panter added the comment: This was changed in Python 3.2+ in Issue 16723. The response object no longer sets the “closed” attribute when it runs out of data; it is only set when the “close” method is called. Perhaps the example should be amended so that it checks if “read” returned an

[issue35617] unittest discover does not work with implicit namespaces

2018-12-30 Thread Martin Panter
Martin Panter added the comment: Is this related to Issue 23882? That one is about making discovery work when “__init__.py” files are removed. -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue35

[issue32419] Add unittest support for pyc projects

2018-12-30 Thread Martin Panter
Martin Panter added the comment: Seems to be a lot of overlap with Issue 26859 by Xavier. Looks like Xavier included a test case, but Bassemʼs changes on Git Hub seem more thorough in the impementation and doc strings. -- nosy: +martin.panter

[issue35611] open doesn't call IncrementalEncoder with final=True

2018-12-29 Thread Martin Panter
Martin Panter added the comment: FWIW this happens with the built-in IDNA codec, and Amaury gave a demonstration under <https://bugs.python.org/issue17404#msg184045>. I don’t think the “TextIOWrapper.flush” method should use final=True, but “close” and “detach” probably

[issue17404] ValueError: can't have unbuffered text I/O for io.open(1, 'wt', 0)

2018-12-29 Thread Martin Panter
Martin Panter added the comment: It is documented that buffering=0 is not supported in text mode. Look a handful of paragraphs down from <https://docs.python.org/release/3.7.2/library/functions.html#open>: “Pass 0 to switch buffering off (only allowed in binary mode)” Amaury’s proble

[issue33661] urllib may leak sensitive HTTP headers to a third-party web site

2018-12-26 Thread Martin Panter
Martin Panter added the comment: Are you aware of the “add_unredirected_header” method? Maybe that is enough to avoid your problem. https://docs.python.org/dev/library/urllib.request.html#urllib.request.Request.add_unredirected_header -- nosy: +martin.panter title: urllib may leak

[issue35483] tarfile.extractall on existing symlink in Ubuntu overwrites target file, not symlink, unlinke GNU tar

2018-12-15 Thread Martin Panter
Martin Panter added the comment: The first aspect, incorrectly assuming the OS does not support symlinks, is described at <https://bugs.python.org/issue23228#msg265146>. Lars proposed a fix <https://bugs.python.org/file42780/windowserror.diff> which will let the OS exception e

[issue19974] tarfile doesn't overwrite symlink by directory

2018-12-15 Thread Martin Panter
Martin Panter added the comment: I’m not sure if this should be considered a bug fix, but if it goes into 2.7 it would overlap with Issue 10761 and Issue 12088. In 2.7 existing directory entries (including broken symlinks, but not including subdirectories) may be replaced by symbolic and

[issue23228] The tarfile module crashes when tarfile contains a symlink and unpack directory contain it too

2018-12-15 Thread Martin Panter
Martin Panter added the comment: The problem with WindowsError should only exist in 3.4+. 2.7 doesn’t support creating symlinks on Windows. Michael’s fix is the same as already done in 2.7 for Issue 10761 and (part of) Issue 12088. However I’m not sure that is the best approach for a bug fix

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

2018-12-13 Thread Martin Panter
Martin Panter added the comment: The only problem with the 3.7+ documentation is the note about 3.2. Several paragraphs under <https://docs.python.org/release/3.7.1/library/subprocess.html#subprocess.Popen>, it still says “Changed in version 3.2: The default for ‘close_fds’ was change

[issue35446] incorrect example

2018-12-10 Thread Martin Panter
Martin Panter added the comment: It doesn’t make sense to move the “except” line without moving the matching “print” line. According to <https://docs.python.org/3.7/reference/compound_stmts.html#index-1>, “A clause consists of a header and a ‘suite’.” So when it talks about reversi

[issue35447] Redundant try-except block in urllib

2018-12-09 Thread Martin Panter
Martin Panter added the comment: That would not include the custom error message for the first two cases I listed. I suggest closing this. -- ___ Python tracker <https://bugs.python.org/issue35

[issue35447] Redundant try-except block in urllib

2018-12-09 Thread Martin Panter
Martin Panter added the comment: Code in question: try: # non-sequence items should not work with len() # non-empty strings will fail this if len(query) and not isinstance(query[0], tuple): raise TypeError # [. . .] except TypeError: ty, va, tb = sys.exc_info

[issue35383] lib2to3 raises ParseError on argument called "print"

2018-12-07 Thread Martin Panter
Martin Panter added the comment: Previous related reports: * Issue 35260: “2to3” doesn’t parse Python 3’s “print” function by default because it is supposed to translate Python 2 syntax * Issue 2412: “2to3” should support “from __future__ import print_function”. That frees up the “print

[issue35390] ctypes not possible to pass NULL c_void_p in structure by reference

2018-12-03 Thread Martin Panter
Martin Panter added the comment: This problem is common to structure fields in general, not just "c_void_p". I recently encountered it with a different type (don't remember the type now, but I notice plain types like c_int share the problem). I found <https://stackover

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-12-02 Thread Martin Panter
Martin Panter added the comment: Yeah, the TarFile class would fix up the header when the user calls “close”. I think this is how it was done for ZipFile (implemented in Issue 26039). Yes currently you would have to build the tarinfo object by hand. I think a helper function would be nice

[issue29541] Python3 error while building on Alt-F

2018-12-02 Thread Martin Panter
Martin Panter added the comment: The missing “crypt” symbol is probably this function: <http://pubs.opengroup.org/onlinepubs/9699919799/functions/crypt.html>. It is defined by the OS or a separate library, not by Python. You may need to link the “_crypt” Python module to the librar

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-12-02 Thread Martin Panter
Martin Panter added the comment: If something like your “addbuffer” method existed, then you won’t need to get the size first, right? We don’t need the changes in “gettarinfo” for “addbuffer” to be useful. BTW have you considered returning a file writer rather than accepting a file reader

[issue35327] Using skipTest with subTest gives a misleading UI.

2018-11-30 Thread Martin Panter
Martin Panter added the comment: Sounds very similar to Issue 25894, discussing how to deal with tests where different subtests errored, failed, skipped and passed. -- nosy: +martin.panter ___ Python tracker <https://bugs.python.org/issue35

[issue35227] [RFE] tarfile: support adding file objects without prior known size

2018-11-27 Thread Martin Panter
Martin Panter added the comment: The changes at <https://github.com/python/cpython/pull/10714/files/11ca0f0> have various other behaviour changes which are not discussed here. They seem to be there just so that you can use the TCP socket from “urlopen” with “gettarinfo”. But “gettarin

[issue14418] Document differences in SocketServer between Python 2.6 and 2.7

2018-11-26 Thread Martin Panter
Martin Panter added the comment: Regarding the first point, “finish” is no longer called after an exception. This was apparently changed in 2.7.4 (see Issue 14574), but Geoffrey was referring to older documentation. Regarding the second point, about ECONNRESET vs graceful shutdown, this

[issue35259] Py_FinalizeEx unconditionally exists in Py_LIMITED_API

2018-11-24 Thread Martin Panter
Martin Panter added the comment: I added the Py_FinalizeEx API in Issue 5319, but was relying on input from others about dealing with Py_LIMITED_API. After reading the documentation <https://docs.python.org/3.6/c-api/stable.html>, I now see that the function would be considered part

[issue35304] The return of truncate(size=None) (file io) is unexpected

2018-11-23 Thread Martin Panter
Martin Panter added the comment: This is the same as Issue 26158. Truncating text files is not clearly documented for a start, and truncating after reading doesn’t seem to be considered much in the implementations. Your question is answered at <https://bugs.python.org/issue26158#msg258

[issue12215] TextIOWrapper: issues with interlaced read-write

2018-11-23 Thread Martin Panter
Martin Panter added the comment: For the record, the more recent bug I mentioned was a complaint from 2015 (one and a half years before Victor’s comment). Even if it is not worth supporting writing after reading, the problem could be documented. -- resolution: out of date -> wont

[issue35282] Add a return value to lib2to3.refactor.refactor_file and refactor_dir

2018-11-20 Thread Martin DeMello
Change by Martin DeMello : -- keywords: +patch pull_requests: +9866 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue35282> ___ ___ Py

[issue35282] Add a return value to lib2to3.refactor.refactor_file and refactor_dir

2018-11-20 Thread Martin DeMello
New submission from Martin DeMello : It would be useful for lib2to3.refactor to return which files were actually changed. Right now that information is logged but not returned. -- components: 2to3 (2.x to 3.x conversion tool) messages: 330149 nosy: martindemello priority: normal

[issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close()

2018-11-14 Thread Martin Panter
Martin Panter added the comment: There are actually two “close” methods in the WSGI package: ServerHandler’s implementation extends the BaseHandler implementation. Making the “close” methods do nothing if called a second time would avoid the error about “self.status” being None, but won’t

[issue35210] Use bytes + memoryview + resize instead of bytesarray + array in io.RawIOBase.read

2018-11-10 Thread Martin Panter
Martin Panter added the comment: Looks like this is about about making “RawIOBase.read” delegate to “readinto” with a “bytes” object. If so, there’s more discussion in Issue 15903. -- nosy: +martin.panter ___ Python tracker <ht

[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-11-07 Thread Martin Bijl-Schwab
Martin Bijl-Schwab added the comment: I will have a look. -- ___ Python tracker <https://bugs.python.org/issue32409> ___ ___ Python-bugs-list mailing list Unsub

[issue33694] test_asyncio: test_start_tls_server_1() fails on Python on x86 Windows7 3.7 and 3.x

2018-11-07 Thread Martin Bijl-Schwab
Change by Martin Bijl-Schwab : -- pull_requests: +9681 ___ Python tracker <https://bugs.python.org/issue33694> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29183] Unintuitive error handling in wsgiref when a crash happens in write() or close()

2018-11-04 Thread Martin Panter
Martin Panter added the comment: Looks like the error handling is broken by Issue 16220, which calls the “BaseHandler.close” method before the exception is caught for the error handler. Perhaps it is better to just close the iterator without messing with the other attributes in the exception

[issue27682] wsgiref BaseHandler / SimpleHandler can raise additional errors when handling an error

2018-11-04 Thread Martin Panter
Martin Panter added the comment: There seem to be at least two different issues raised here (and in Issue 34547): 1. Double exceptions due to “self.environ” and “self.status” being None when the error handler is called. This problem was specifically raised in Issue 29183. 2. What to do

[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-11-02 Thread Martin Bijl-Schwab
Martin Bijl-Schwab added the comment: I meant https://bugs.python.org/issue35148 -- ___ Python tracker <https://bugs.python.org/issue32409> ___ ___ Python-bug

[issue32409] venv activate.bat is UTF-8 encoded but uses current console codepage

2018-11-02 Thread Martin Bijl-Schwab
Martin Bijl-Schwab added the comment: it does not work as expected on swiss german (and likely other internationalised) windows systems. See https://bugs.python.org/issue32409 -- nosy: +Martin Bijl-Schwab ___ Python tracker <ht

[issue35148] cannot activate a venv environment on a Swiss German windows

2018-11-02 Thread Martin Bijl-Schwab
New submission from Martin Bijl-Schwab : There is a small bug in the activate.bat script causing problems on internationalized Windows systems. C:\repo\gui>python -m venv venv C:\repo\gui>call venv\Scripts\activate.bat Parameterformat falsch - 850. This translates to "Wrong para

[issue28960] Small typo in Thread.join docs

2018-10-22 Thread Martin Panter
Change by Martin Panter : -- Removed message: https://bugs.python.org/msg328245 ___ Python tracker <https://bugs.python.org/issue28960> ___ ___ Python-bugs-list m

[issue30250] StringIO module truncate behavior of current position

2018-10-13 Thread Martin Panter
Change by Martin Panter : -- assignee: -> docs@python components: +Documentation nosy: +docs@python title: StreamIO truncate behavior of current position -> StringIO module truncate behavior of current position ___ Python tracker

[issue34920] PYTHONWARNINGS entries are escaped

2018-10-12 Thread Martin Panter
Change by Martin Panter : -- resolution: -> duplicate stage: -> resolved status: open -> closed ___ Python tracker <https://bugs.python.org/issue34920> ___ ___

[issue34951] cookielib/cookiejar cookies' Expires date parse fails with long month names

2018-10-10 Thread Martin Panter
Martin Panter added the comment: RFC 6265 says that only the first three letters of the month are significant, and the rest of the token should be ignored. See <https://tools.ietf.org/html/rfc6265#section-5.1.1>: month = ( "jan" / "feb" / "mar" / &quo

[issue34942] Add an FAQ note about floating point representation

2018-10-09 Thread Martin Panter
Martin Panter added the comment: Have you seen <https://docs.python.org/3/faq/design.html#why-are-floating-point-calculations-so-inaccurate>? It already links to the tutorial. -- nosy: +martin.panter ___ Python tracker <https://bugs.p

[issue34920] PYTHONWARNINGS entries are escaped

2018-10-07 Thread Martin Panter
Martin Panter added the comment: Déjà vu. Maybe duplicate of Issue 34624? -- nosy: +martin.panter superseder: -> -W option does not accept module regexes ___ Python tracker <https://bugs.python.org/issu

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