[issue29573] NamedTemporaryFile with delete=True should not fail if file already deleted

2017-03-27 Thread Martin Panter
Martin Panter added the comment: See also Issue 27425, about making the deletion step more flexible after the file has been created, which might help here. I’m not sure about security problems, but IMO failure to remove a temporary file (because it is already gone, or some other reason) is

[issue29251] Class __dict__ is only a mapping proxy

2017-03-27 Thread Martin Panter
Martin Panter added the comment: I don’t know if it is an implementation detail or not. Maybe it is the documentation itself which defines that. Anyway, I think your wording would have been fine for my original problem. I wonder if we should clarify that only reading the mapping is supported

[issue29928] Add f-strings to Glossary

2017-03-28 Thread Martin Panter
Martin Panter added the comment: When I wrote the documentation <https://docs.python.org/dev/reference/lexical_analysis.html#f-strings>, I think I tried to avoid “f-string”, being jargon, and used more formal terminology from PEP 498 instead. But I agree they more than regular li

[issue29951] PyArg_ParseTupleAndKeywords exception messages containing "function"

2017-03-31 Thread Martin Panter
Martin Panter added the comment: In this test, “keyword arguments” is definitely wrong: >>> f(**{1:2}) -TypeError: f() keywords must be strings +TypeError: f() keyword arguments must be strings To me, a keyword argument is a _value_ passed in using the f(name=. . .) syntax, and th

[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2017-03-31 Thread Martin Panter
Changes by Martin Panter : -- nosy: -martin.panter ___ Python tracker <http://bugs.python.org/issue27100> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue28556] typing.py upgrades

2017-03-31 Thread Martin Panter
Changes by Martin Panter : -- nosy: -martin.panter ___ Python tracker <http://bugs.python.org/issue28556> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27867] various issues due to misuse of PySlice_GetIndicesEx

2017-03-31 Thread Martin Panter
Changes by Martin Panter : -- nosy: -martin.panter ___ Python tracker <http://bugs.python.org/issue27867> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue26947] Hashable documentation improvement needed

2017-04-01 Thread Martin Panter
Martin Panter added the comment: The pull request currently suggests “All of Python’s immutable built-in objects are hashable; mutable containers (such as lists or dictionaries) are not.” This seems better wording than the original. FWIW, I would have tried “Python’s built-in immutable

[issue29751] PyLong_FromString documentation wrong on numbers with leading zero and base=0

2017-04-01 Thread Martin Panter
Martin Panter added the comment: Underscores are only applicable to 3.6+, but the original concern about leading zeros applies to 3.5. On Git Hub I suggested dropping the details and just referring to the Lexical Analysis section <https://docs.python.org/3.5/reference/lexical_analysis.h

[issue29947] In SocketServer, why not passing a factory instance for the RequestHandlerClass instead of the class itself?

2017-04-01 Thread Martin Panter
Martin Panter added the comment: By “factory instance”, I presume you just mean a function (or class or method) that returns an appropriate object when called. (I think these are normally called “factory functions”. Instances are objects, the things that class constructors and factories

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Martin Panter
Martin Panter added the comment: Are you sure? It works for me: >>> strptime("+0200", "%z").tm_gmtoff 7200 >>> strptime("+", "%z").tm_gmtoff 0 The "struct_time" class is documented as a named tuple, but the time zone o

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Martin Panter
Martin Panter added the comment: As far as I can see, the documentation only claims that “mktime” converts local time. If you saw a suggestion that it supports arbitrary time zones, please point it out. -- ___ Python tracker <h

[issue29964] %z directive has no effect on the output of time.strptime

2017-04-02 Thread Martin Panter
Martin Panter added the comment: We could change this to a documentation issue if you have any suggestions to make the documentation clearer. I understand the “time” module is mainly a wrapper or emulator of the OS’s own strptime, mktime, etc functions, which explains some of these quirks

[issue29926] time.sleep ignores _thread.interrupt_main()

2017-04-02 Thread Martin Panter
Martin Panter added the comment: Hi Terry, this patch is what I imagined a fix would look like for Linux. I am not familiar with Idle (internally nor externally), so there may be improvements you can make. It works as I expected for normal blocking functions and a tight “for” loop: it

[issue29926] time.sleep ignores _thread.interrupt_main()

2017-04-02 Thread Martin Panter
Martin Panter added the comment: BTW pthread_kill was only added to Python 3.3, so is not available for Python 2. I’m not sure what the best fix for 2.7 would be. Maybe it’s not worth it, or maybe you can find another way to a signal to the user process or its main thread without interfering

[issue29967] "AMD64 FreeBSD 9.x 3.x" tries to rebuild Include/opcode.h, timestamp issue

2017-04-03 Thread Martin Panter
Martin Panter added the comment: I think this is the same underlying problem as Issue 23404. Either we get “make touch” working without Mercurial, or we use some other mechanism to either disable regeneration by default (my preference), or disable regeneration by explicit request (possible

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

2017-04-03 Thread Martin Panter
Martin Panter added the comment: I had mainly been using my boot-flag.patch with BSD Make (bmake) rather than Gnu Make. It seems I was relying on a bug in BSD Make that merges escaped newlines in command lines, despite Posix and Gnu Make. Anyway, Chi’s fix seems appropriate. I am posting the

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

2017-04-03 Thread Martin Panter
Changes by Martin Panter : Added file: http://bugs.python.org/file46773/boot-flag.py2.patch ___ Python tracker <http://bugs.python.org/issue23404> ___ ___ Python-bug

[issue29968] Document that no characters are allowed to proceed \ in explicit line joining

2017-04-03 Thread Martin Panter
Martin Panter added the comment: I think he means make something like the following legal, where dots (.) indicate space characters: a.=.\. b At the moment it is a SyntaxError: >>> a = \ File "", line 1 a = \ ^ SyntaxError: unexpected character afte

[issue29975] Issue in extending documentation

2017-04-03 Thread Martin Panter
Martin Panter added the comment: FWIW I don’t see any error in the first quote. “Should X happen, Y happens” is valid English. Though I admit this kind of grammar is not used that often. If it is too hard to understand, it should be okay to change it to “If it becomes a danging pointer

[issue29987] inspect.isgeneratorfunction not working with partial functions

2017-04-04 Thread Martin Panter
Martin Panter added the comment: Doesn't seem like a bug to me. Even if there was special support for "partial" objects, that won't help with other ways of producing the same sort of thing. test2 = functools.partial(test, a=10) @functools.wraps(test) def test2(): ret

[issue29991] http client marks valid multipart headers with defects.

2017-04-05 Thread Martin Panter
Martin Panter added the comment: Looks like a duplicate of Issue 29353, which has a more complete patch proposed. However, see my comment about a problem with using heartersonly=True. My policy-flag.v2.patch for Issue 24363 may help (the details have faded from my mind, but I suspect it will

[issue29987] inspect.isgeneratorfunction not working with partial functions

2017-04-05 Thread Martin Panter
Martin Panter added the comment: Not in general. I think you would have to make special cases for partial functions, __wrapped__, and whatever else there is, and combinations of these. It would be very hard to determine the correct result for test2 in test2 = lambda: test(a=10) # test2

[issue30012] gzip.open(filename, "rt") fails on Python 2.7.11 on win32, invalid mode rtb

2017-04-07 Thread Martin Panter
Martin Panter added the comment: I agree this is not a bug. It is just one of the unfortunate compatibility breaks between Py 2 and 3. Mode="rt" is not one of the values that are supported according to the documentation; adding support would be a new feature. I understand the

[issue29989] subprocess.Popen does not handle file-like objects without file descriptors

2017-04-07 Thread Martin Panter
Martin Panter added the comment: Raphael: Can you point to the implementation code that handles file objects without a file descriptor (or give a demonstration of it)? I suspect there is no such support and you are mistaken. Perhaps we can instead clarify in the “subprocess” documentation

[issue30017] zlib.error: Error -2 while flushing: inconsistent stream state

2017-04-07 Thread Martin Panter
Martin Panter added the comment: It looks like the zip entry writer object may not expect its “close” method to be called multiple times. Other file objects tend to allow this with no ill effect. Adding Serhiy and Thomas who implemented the writer object in Issue 26039. The first time it is

[issue30000] Inconsistency in the zlib module

2017-04-07 Thread Martin Panter
Martin Panter added the comment: I don’t have a strong opinion on adding the missing parameters to the one-shot “compress” function, though it does seem beneficial to have a consistent set of parameters supported across the relevant APIs

[issue29944] Argumentless super() fails in classes constructed with type()

2017-04-08 Thread Martin Panter
Martin Panter added the comment: In Issue 23674, I posted a patch that changes to consistent parameter names (subclass, self). The exception message would avoid “type”, becoming super(subclass, self): self must be an instance or subtype of subclass -- nosy: +martin.panter

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

2017-04-08 Thread Martin Panter
Martin Panter added the comment: The magical no-argument call could also be clarified: 8. Define in the main text what happens when you omit the first argument (the subclass) to “super”. At the moment, I think the reader could infer that it is the method’s class, but this is only hinted by

[issue14039] Add "metavar" argument to add_subparsers() in argparse

2017-04-09 Thread Martin Panter
Martin Panter added the comment: Thanks to Issue 11807, the documentation now lists “metavar”. (However, it looks like a positional argument, rather than keyword-only, and its use seems to be discouraged, but those issues are not specific to “metavar”.) Some points specific to “metavar” that

[issue29030] argparse: choices override metavar

2017-04-09 Thread Martin Panter
Martin Panter added the comment: I think the documentation should be fixed to say choices overrides dest, and the implementation should be left alone. Even if the documentation is not a “formal module reference”, it should not be wrong or misleading. Also, Issue 14039 is related, about

[issue29989] subprocess.Popen does not handle file-like objects without file descriptors

2017-04-09 Thread Martin Panter
Martin Panter added the comment: The current exception seems to give a reasonable hint: >>> subprocess.Popen((executable,), stdout=BytesIO()) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/subprocess.py", line 914, in __init__

[issue30037] inspect documentation on code attributes incomplete

2017-04-11 Thread Martin Panter
Martin Panter added the comment: Looks like a there is already a patch discussed at Issue 26985. -- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Information about CodeType in inspect documentation

[issue30041] subprocess: weird behavior with shell=True and args being a list

2017-04-11 Thread Martin Panter
Martin Panter added the comment: This is as documented, but perhaps see Issue 20344 about clarifying the documentation. -- nosy: +martin.panter resolution: -> not a bug stage: -> resolved status: open -> closed superseder: -> subprocess.check_output() docs misrepresen

[issue30075] Printing ANSI Escape Sequences on Windows 10

2017-04-15 Thread Martin Panter
Martin Panter added the comment: Maybe this is related to Issue 29059. If so, there seems to be resistance to enabling the feature by default, and preference to use existing APIs rather than adding a new API that enables it. -- components: +Windows nosy: +martin.panter, paul.moore

[issue30084] starred tuple expression vs list display and function call

2017-04-16 Thread Martin Panter
Martin Panter added the comment: This doesn’t seem like a bug to me. At least it is consistent with the rule for making a tuple when there are commas versus returning the direct expression when there are no commas: >>> x = (1); type(x) >>> x = (1,); type(x) I don’t

[issue30112] useful things

2017-04-20 Thread Martin Panter
Changes by Martin Panter : -- Removed message: http://bugs.python.org/msg291956 ___ Python tracker <http://bugs.python.org/issue30112> ___ ___ Python-bugs-list m

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

2017-04-21 Thread Martin Panter
Martin Panter added the comment: Last time I proposed removing the automatic rebuilding of checked-in generated files, it seemed getting a consensus would not be trivial. Nick seemed strongly against changing the status quo: <https://mail-archive.com/search?l=mi

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

2017-04-22 Thread Martin Panter
Martin Panter added the comment: Do you mean a separate makefile rule to rebuild the generated files, rather than rebuilding them in a normal “make all” build? I would support this; this is what I meant with my “make regenerate” proposal in response to Nick linked above

[issue30134] BytesWarning is missing from the documents

2017-04-22 Thread Martin Panter
Martin Panter added the comment: . Issue 11681 is already open for the -b option, with a patch in progress. If updating the doc string, also change “buffer” to “bytearray”. This is what “bytearray” was originally called in Python 3, and “buffer” is something different in Python 2

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

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

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

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

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

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

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

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

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

2017-04-26 Thread Martin Panter
Changes by Martin Panter : -- nosy: -martin.panter ___ Python tracker <http://bugs.python.org/issue28769> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29606] urllib FTP protocol stream injection

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

[issue30160] BaseHTTPRequestHandler.wfile: supported usage unclear

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

[issue30103] uu package uses old encoding

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

[issue29606] urllib FTP protocol stream injection

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

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

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

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

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

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

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

[issue30103] uu package uses old encoding

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

[issue29606] urllib FTP protocol stream injection

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

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

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

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

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

[issue15346] Tkinter extention modules have no documentation

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

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

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

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

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

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

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

[issue4755] Add function to get common path prefix

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

[issue12077] Harmonizing descriptor protocol documentation

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

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

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

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

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

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

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

[issue30302] Improve .__repr__ implementation for datetime.timedelta

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

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

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

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

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

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

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

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

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

[issue30311] random.shuffle pointlessly shuffles dicts

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

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

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

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

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

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

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

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

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

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

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

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

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

[issue30302] Improve .__repr__ implementation for datetime.timedelta

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

[issue30420] Clarify kwarg handing for subprocess convenience APIs

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

[issue30420] Clarify kwarg handing for subprocess convenience APIs

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

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

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

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

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

[issue30437] SSL_shutdown can return meaningless SSL_ERROR_SYSCALL

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

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

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

[issue30477] tuple.index error message improvement

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

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

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

[issue30393] test_readline hangs

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

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

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

[issue30500] urllib connects to a wrong host

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

[issue29596] Unfinished sentence in howto/clinic.rst

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

[issue30516] Documentation for datetime substract operation incorrect?

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

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

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

[issue30458] CRLF Injection in httplib

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

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

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

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

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

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

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

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

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

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

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

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

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

[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

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