[issue29885] Allow GMT timezones to be used in datetime.

2017-03-23 Thread Martin Panter
Martin Panter added the comment: Does the “astimezone” method work for you? <https://docs.python.org/3.5/library/datetime.html#datetime.datetime.astimezone> >>> from datetime import * >>> aedt = timezone(+timedelta(hours=11)) >>> local = datetime.now(aedt) &g

[issue20631] python readline module crashing on NULL access

2017-03-23 Thread Martin Panter
Martin Panter added the comment: Closing in favour of Issue 13501, since the report was apparently about using a non-Apple Editline rather than Gnu Readline. However see also Issue 29854, where the same symptom is seen with Gnu Readline, and it will probably get the same fix

[issue20631] python readline module crashing on NULL access

2017-03-23 Thread Martin Panter
Changes by Martin Panter : -- resolution: -> duplicate stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue20631] python readline module crashing on NULL access

2017-03-23 Thread Martin Panter
Changes by Martin Panter : -- superseder: -> Make libedit support more generic; port readline / libedit to FreeBSD ___ Python tracker <http://bugs.python.org/issu

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

2017-03-23 Thread Martin Panter
Martin Panter added the comment: Gnu Readline comes includes its own documentation (e.g. /usr/share/info/history.info.gz on my computer). It is also at <https://cnswww.cns.cwru.edu/php/chet/readline/history.html>. Perhaps the history_base value is relevant; see some of the comments st

[issue29891] urllib.request.Request accepts but doesn't check bytes headers

2017-03-24 Thread Martin Panter
Martin Panter added the comment: If you enable BytesWarning (python -b) you do get an error: >>> urlopen(req, data) Traceback (most recent call last): File "", line 1, in File "/usr/lib/python3.5/urllib/request.py", line 162, in urlopen return opener.op

[issue27446] struct: allow per-item byte order

2017-03-25 Thread Martin Panter
Martin Panter added the comment: This seems too obscure to be worth supporting in the built-in library IMO. The use case loses one line of code but gains a more complicated structure format string. -- nosy: +martin.panter ___ Python tracker <h

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

2017-03-25 Thread Martin Panter
Martin Panter added the comment: A backwards-compatible way forward would be to preserve (and document) the “format” attribute as a byte string, and add a new attribute which is definitely a text string. Not sure of a good name; perhaps “Struct.text_format” or “format_str” is a start

[issue29903] struct.Struct Addition

2017-03-25 Thread Martin Panter
Martin Panter added the comment: For the native alignment case (prefix code @), perhaps you can already use the “ctypes” module, which supports structures with more complicated embedded fields. For the the unaligned modes (prefixes =, <, > and !), I am a little sympathetic. In the p

[issue29907] Unicode encoding failure

2017-03-25 Thread Martin Panter
Martin Panter added the comment: I presume you are trying to print to the normal Windows console. I understand the console was not well supported until Python 3.6 (see Issue 1602). Have you tried that version? I’ll leave this open for someone more experienced to confirm, but I suspect what

[issue23901] Force console stdout to use UTF8 on Windows

2017-03-25 Thread Martin Panter
Martin Panter added the comment: This seems to be discussing the same sort of stuff that ended up with the Issue 1602 implementation. -- nosy: +martin.panter resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> windows console doesn'

[issue18022] Inconsistency between quopri.decodestring() and email.quoprimime.decode()

2017-03-26 Thread Martin Panter
Martin Panter added the comment: The double equals "==" case for the “quopri” implementation in Python is now consistent with the others thanks to the fix in Issue 23681 (see also Issue 21511). According to Issue 20121, the quopri (Python) implementation only supports LF (\n) cha

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

2017-03-27 Thread Martin Panter
Martin Panter added the comment: Hi Victor, I’m not sure about changing the data type. As Python 3 grows older, there is potentially more code being written that you break by fixing a bug like this. It is incompatible if you used to write >>> print(struct.Struct('hi').for

[issue4928] tempfile.NamedTemporaryFile: automatic cleanup by OS

2017-03-27 Thread Martin Panter
Changes by Martin Panter : -- title: Problem with tempfile.NamedTemporaryFile -> tempfile.NamedTemporaryFile: automatic cleanup by OS ___ Python tracker <http://bugs.python.org/iss

[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

[issue30306] release arguments of contextmanager

2017-05-08 Thread Martin Teichmann
New submission from Martin Teichmann: The arguments of a function which was decorated to be a context manager are stored inside the context manager, and are thus kept alive. This is a memory leak. Example: @contextmanager def f(a): do_something_with(a) a = None

[issue30306] release arguments of contextmanager

2017-05-08 Thread Martin Teichmann
Changes by Martin Teichmann : -- pull_requests: +1602 ___ Python tracker <http://bugs.python.org/issue30306> ___ ___ Python-bugs-list mailing list Unsubscribe:

[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

[issue30306] release arguments of contextmanager

2017-05-09 Thread Martin Teichmann
Martin Teichmann added the comment: I personally prefer the current situation. The problem is the following: when an @contextmanager is first called, we don't know yet whether the user wants to use it directly, or as a decorator, so we have to have some kind of hybrid class. Once it'

[issue30306] release arguments of contextmanager

2017-05-17 Thread Martin Teichmann
Martin Teichmann added the comment: Hi, so where do we go from here? I could write the proposed allow_recreation flag, but IMHO this adds only dead code, as it is of no need at all. I don't think code gets more clear by adding dead code... I opted for one line more of comment, I think

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

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