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

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

[issue1732367] Document the constants in the socket module

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

[issue1732367] Document the constants in the socket module

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

[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

[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

[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

[issue31320] test_ssl logs a traceback

2017-09-03 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. A

[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_exclusive

[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

[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 and

[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” or

[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

[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 on the

[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

[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 <https://bugs.python.org/issue19

[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 <https://bugs.python.org/issue30

[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

[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

[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 actually

[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) are

[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 <https://bugs.python.org/issue31

[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

[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

[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

[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

[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

[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

[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

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

[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: 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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

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

[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

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

[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

[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

[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

[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;')

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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

[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.

[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

[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

[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

[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

[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

[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

[issue29706] IDLE needs syntax highlighting for async and await

2017-03-03 Thread Martin Panter
Martin Panter added the comment: See also Issue 26264 about the “keyword” module -- nosy: +martin.panter ___ Python tracker <http://bugs.python.org/issue29

[issue29715] Arparse improperly handles "-_"

2017-03-03 Thread Martin Panter
Martin Panter added the comment: This is actually expected behaviour of the “argparse”, as well as general Unix CLI programs. See the documentation <https://docs.python.org/3.6/library/argparse.html#arguments-containing>. The general workaround is to use a double-dash sep

[issue29700] readline memory corruption when sys.stdin fd >= FD_SETSIZE for select()

2017-03-06 Thread Martin Panter
Martin Panter added the comment: “Input9)” is probably a typo for “input()”. In Python 2, sys.stdin etc are by default wrappers around ’s “stdin” etc, and can easily be wrappers around other FILE objects, so the PyOS_Readline API and Python’s “readline” module pass these objects directly

[issue29741] BytesIO methods don't accept integer types, while StringIO counterparts do

2017-03-06 Thread Martin Panter
Martin Panter added the comment: What is the use case? Unless changing the behaviour would be useful, I think the simplest solution would be to document that the methods should only be given instances of “int”, so that it is clear that other kinds of numbers are unsupported. -- nosy

[issue29751] PyLong_FromString fails on decimals with leading zero and base=0

2017-03-07 Thread Martin Panter
Martin Panter added the comment: My guess is this is supposed to emulate (or is actually the implementation of) the "int" constructor and the Python syntax. In these cases, numbers with leading zeros are disallowed. This was to help with Python 2 porting, where a leading zero sp

[issue29786] asyncio.wrap_future() is not documented

2017-03-10 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> asyncio.wrap_future undocumented ___ Python tracker <http://bugs.python

[issue24755] asyncio.wrap_future undocumented

2017-03-10 Thread Martin Panter
Changes by Martin Panter : -- components: +asyncio stage: -> patch review versions: +Python 3.6, Python 3.7 ___ Python tracker <http://bugs.python.org/issu

[issue29783] Modify codecs.open() to use the io module instead of codecs.StreamReaderWriter()

2017-03-10 Thread Martin Panter
Martin Panter added the comment: I agree that it would be better to hold off deprecating codecs.open until Python 2 is no longer supported. This deprecation also discussed in Issue 8796. There is more to compatability than the missing attributes. The most obvious one to me is that the

[issue29746] Update marshal docs to Python 3

2017-03-10 Thread Martin Panter
Martin Panter added the comment: One other difference between 2 and 3 is that Python 3 has two kinds of “binary” files. In most cases, a subset of the BufferedIOBase API is assumed, which does “exact” reads and writes. I understand this is how Python 2 files worked. But there is also

[issue29788] tarfile: Add absolute_path option to tarfile, disabled by default

2017-03-10 Thread Martin Panter
Martin Panter added the comment: The CLI was added in Issue 13477. I didn’t see any discussion of traversal attacks there, so maybe it was overlooked. Perhaps there should also be a warning, like with the Tarfile.extract and “extractall” methods. However I did see one of the goals was to keep

[issue21109] tarfile: Traversal attack vulnerability

2017-03-10 Thread Martin Panter
Martin Panter added the comment: Issue 29788 proposes an option to disable the vulnerability in the CLI -- dependencies: +tarfile: Add absolute_path option to tarfile, disabled by default ___ Python tracker <http://bugs.python.org/issue21

[issue15082] [httplib] httplib.BadStatusLine on any HTTPS connection in certain unknown cases.

2017-03-12 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> fixed stage: -> test needed status: open -> pending ___ Python tracker <http://bugs.python.org/issue15082> ___ ___

[issue7427] BadStatusLine is hell to debug

2017-03-12 Thread Martin Panter
Martin Panter added the comment: This change was only made in 2.7a4, not 2.6 -- versions: +Python 2.7 -Python 2.6 ___ Python tracker <http://bugs.python.org/issue7

[issue8450] httplib: false BadStatusLine() raised

2017-03-12 Thread Martin Panter
Martin Panter added the comment: I don’t think so. It is best to avoid a new exception type (even a subclass) in a bug fix. That would break code which checks “type(exc) == BadStatusLine” or similar. Specific exception messages are supposed to be implementation details, and the current

[issue29799] Add tests for header API of 'urllib.request.Request' class

2017-03-12 Thread Martin Panter
New submission from Martin Panter: I think the RequestTests class really belongs in test_urllib2, which already has a RequestHdrsTests class testing these APIs. BTW test_urllib.py (no 2) is mainly for testing the stuff that came from Python 2’s “urllib” module, but the Request class is in

[issue29715] Arparse improperly handles "-_"

2017-03-13 Thread Martin Panter
Martin Panter added the comment: Max, I’m not sure if you saw the double-dash (--) workaround. IMO that is the “correct” way to do this for Unix command lines, and for the current version of “argparse”. But I guess that may be too inconvenient for your Morse Code case. Perhaps you can write

[issue12284] argparse.ArgumentParser: usage example option

2017-03-13 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> works for me stage: needs patch -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue26602] argparse doc introduction is inappropriately targeted

2017-03-14 Thread Martin Panter
Martin Panter added the comment: The patch looks unfinished. I left some narrow nit-picky review comments, but I haven’t really thought about the problem from a high level. -- nosy: +martin.panter stage: -> patch review versions: +Python 2.7, Python 3.5, Python 3.6, Python

[issue29807] ArgParse page in library reference rewrite

2017-03-14 Thread Martin Panter
Martin Panter added the comment: Also see Issue 26602 and Issue 11176, each with patches. Perhaps you could help review and combine them. -- nosy: +martin.panter ___ Python tracker <http://bugs.python.org/issue29

[issue29387] Tabs vs spaces FAQ out of date

2017-03-14 Thread Martin Panter
Martin Panter added the comment: The “tabnanny” script was removed from Tools/scripts/ in 2.0: <https://github.com/python/cpython/commit/a02c898>. So the 2.7 FAQ also has the wrong location. -- ___ Python tracker <http://bugs.python.org/i

[issue29809] TypeError in traceback.print_exc - unicode does not have the buffer interface

2017-03-14 Thread Martin Panter
Martin Panter added the comment: FWIW I tend to use cStringIO.StringIO as a Python 2 replacement for io.StringIO to avoid this str vs unicode problem. But that only accepts ASCII, so won't help you if you really need the UTF-8 encoding step. -- nosy: +martin.p

[issue29815] Fail at divide a negative integer number for a positive integer number

2017-03-15 Thread Martin Panter
Martin Panter added the comment: If you ignore the c[0] argument, the rest looks fine to me. See the documentation at <https://docs.python.org/2/reference/expressions.html#binary-arithmetic-operations> and <https://docs.python.org/2/library/stdtypes.html#numeric-types-int-float-lon

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

2017-03-15 Thread Martin Panter
Martin Panter added the comment: Perhaps a duplicate of Issue 1043134? -- nosy: +martin.panter superseder: -> Add preferred extensions for MIME types versions: -Python 3.3, Python 3.4 ___ Python tracker <http://bugs.python.org/issu

[issue29831] os.path.exists seems can not recgnize "~"

2017-03-16 Thread Martin Panter
Martin Panter added the comment: I agree with Josh. This is how it is supposed to work. os.system calls the shell (e.g. Bash) rather than running the "ls" program directly. Unix shells translate "~" to the home directory (as well as translating a lot of other stuff, e.g

[issue29700] readline memory corruption when sys.stdin fd >= FD_SETSIZE for select()

2017-03-18 Thread Martin Panter
Martin Panter added the comment: Marien’s pull request is for 2.7 and adds two new paths when raw_input is called: * On Linux (actually glibc), use “poll” rather than “select” * In other cases, if sys.stdin cannot be used with “select”, raise ValueError Marien admits that even in the best

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