[issue23174] shelve.open fails with error "anydbm.error: db type could not be determined"

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed error message isn't correct. The file extension is not the only method for determining db type. Current error message looks good to me and I don't see how it can be enhanced. -- nosy: +serhiy.storchaka

[issue23174] shelve.open fails with error "anydbm.error: db type could not be determined"

2017-04-16 Thread Anand Reddy Pandikunta
Anand Reddy Pandikunta added the comment: dbm.whichdb mentions that it returns empty string ('') if the file’s format can’t be guessed. Enhancing exception message should suffice. -- nosy: +ChillarAnand ___ Python tracker

[issue23174] shelve.open fails with error "anydbm.error: db type could not be determined"

2017-04-16 Thread Roundup Robot
Changes by Roundup Robot : -- pull_requests: +1291 ___ Python tracker ___

[issue25794] __setattr__ does not always overload operators

2017-04-16 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue30086] type() and len() recognize "abc", expression as "abc" string.

2017-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: What you're seeing is a feature of the grammar. Function allow an optional trailing comma in the argument list: >>> pow(2, 5) 32 >>> pow(2, 5,) 32 So, to create a tuple inside in an argument list, you need the extra layer of parentheses.

[issue30086] type() and len() recognize "abc", expression as "abc" string.

2017-04-16 Thread umedoblock
New submission from umedoblock: But I found a real bug to use a tuple with a comma. Python3 recognized "abc", expression as tuple of one element. But type() and len() recognize "abc", expression as "abc" string. So now, I found a real bug. I'll show you below sentences. >>> "abc", ('abc',)

[issue11822] Improve disassembly to show embedded code objects

2017-04-16 Thread Nick Coghlan
Nick Coghlan added the comment: Yeah, I was mixing this up with getargspec (et al), which get used by IDEs and similar tools. While third party tools do use the disassembler, they typically won't use its display logic directly unless they're just dumping the output to a terminal equivalent.

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

2017-04-16 Thread umedoblock
umedoblock added the comment: Sorry and thanks to Martin and Steven. I agree with your post about first my post. I understand "(*x) is equivalent to just bare *x." -- ___ Python tracker

[issue30076] Opcode names BUILD_MAP_UNPACK_WITH_CALL and BUILD_TUPLE_UNPACK_WITH_CALL are too long

2017-04-16 Thread Nick Coghlan
Nick Coghlan added the comment: If we used the names from inspect.Parameter.kind (https://docs.python.org/3/library/inspect.html#inspect.Parameter.kind) these would become: * BUILD_VAR_POSITIONAL * BUILD_VAR_KEYWORD which would be 20 and 17 letters long, respectively. I think that would

[issue30040] new empty dict can be more small

2017-04-16 Thread Louie Lu
Louie Lu added the comment: forgive my words, I trace the wrong code, sorry about that. -- ___ Python tracker ___

[issue30040] new empty dict can be more small

2017-04-16 Thread Louie Lu
Louie Lu added the comment: Inada's patch version act different inside `PyObject_SetItem`, when running this code: 'x = {}; x['a'] = 123' at PyObject_SetItem, patch version goes to this line: >│179 if (m && m->mp_ass_subscript) │180 return m->mp_ass_subscript(o, key,

[issue23787] sum() function docstring lists arguments incorrectly

2017-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: I believe this is just a 2.7 issue. -- versions: -Python 3.5, Python 3.6, Python 3.7 ___ Python tracker ___

[issue30080] Add the --duplicate option for timeit

2017-04-16 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -Guido.van.Rossum, gvanrossum ___ Python tracker ___

[issue30085] Discourage operator.__dunder__ functions

2017-04-16 Thread Steven D'Aprano
New submission from Steven D'Aprano: As discussed on the Python-Ideas mailing list, it is time to discourage the use of operator.__dunder__ functions. Not to remove them or deprecate them, just change the documentation to make it clear that the dunderless versions are preferred. Guido +1'ed

[issue30051] Document that the random module doesn't support fork

2017-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: Several thoughts: * AFAICT, in entire the history of this module, no user has ever reported this as being a source of confusion, so I don't think there is a real documentation issue here. * Regarding, "after fork, the parent and the child produce the

[issue30051] Document that the random module doesn't support fork

2017-04-16 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- assignee: docs@python -> rhettinger ___ Python tracker ___

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

2017-04-16 Thread Steven D'Aprano
Steven D'Aprano added the comment: > list expression pass starred expression, the other hand > tuple expression cannot pass starred expression. You are misinterpreting what you are seeing. ( ) is not a tuple expression (except for the special case of empty brackets, which makes an empty

[issue30080] Add the --duplicate option for timeit

2017-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: +1 I've long used this technique when timing fast statements. See https://code.activestate.com/recipes/577834 for an example. -- ___ Python tracker

[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 think it is worth

[issue23787] sum() function docstring lists arguments incorrectly

2017-04-16 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- assignee: docs@python -> Mariatta nosy: +Mariatta versions: +Python 3.5, Python 3.6, Python 3.7 ___ Python tracker

[issue30084] about starred expression

2017-04-16 Thread umedoblock
New submission from umedoblock: Hi, all. First of all, my python environment is below. Python 3.5.2+ (default, Sep 22 2016, 12:18:14) [GCC 6.2.0 20160927] on linux = differ evaluation order about starred expression I get below result then I run x.py

[issue26828] Implement __length_hint__() on map() and filter() to optimize list(map) and list(filter)

2017-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: [STINNER Victor] > Oh, there is no slot for __length_hint__(). > Maybe we should also try to add a new slot for it? +1 -- ___ Python tracker

[issue23787] sum() function docstring lists arguments incorrectly

2017-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: [Serhiy] > Raymond, could you open a pull request? Perhaps you could do it for me. I still haven't had time to wrestle with the github switchover, so I'm effectively crippled for a while. [Valentine] > Seems like mentioning string was really a bad idea

[issue30077] Support Apple AIFF-C pseudo compression in aifc.py

2017-04-16 Thread Toby Thurston
Toby Thurston added the comment: I think it's probably better as a no-op. Currently in my patch I just put return data You could do return data[::-1] to reverse the sample, so that it came out as big endian, but if you leave it as a no-op then the data is returned in the native

[issue11822] Improve disassembly to show embedded code objects

2017-04-16 Thread Raymond Hettinger
Raymond Hettinger added the comment: > if we modify dis() instead of adding a new function, then > the default behaviour needs to be non-recursive for > backwards compatibility reasons I don't see how we have any backward compatibility issues. The dis() function is purely informational like

[issue14976] queue.Queue() is not reentrant, so signals and GC can cause deadlocks

2017-04-16 Thread Itamar Turner-Trauring
Itamar Turner-Trauring added the comment: This bug was closed on the basis that signals + threads don't interact well. Which is a good point. Unfortunately this bug can happen in cases that have nothing to do with signals. If you look at the title and some of the comments it also happens as a

[issue30083] Asyncio: GeneratorExit + strange exception

2017-04-16 Thread Марк Коренберг
Changes by Марк Коренберг : -- components: +asyncio nosy: +yselivanov versions: +Python 3.5 ___ Python tracker ___

[issue30083] Asyncio: GeneratorExit + strange exception

2017-04-16 Thread Марк Коренберг
New submission from Марк Коренберг: How to reproduce: Run the following program: = import asyncio async def handle_connection(reader, writer): try: await reader.readexactly(42) except BaseException as err: print('Interesting: %r.' % err)

[issue30077] Support Apple AIFF-C pseudo compression in aifc.py

2017-04-16 Thread Xiang Zhang
Xiang Zhang added the comment: Anyway, such a function addition could only get into 3.7. -- nosy: +xiang.zhang ___ Python tracker ___

[issue30082] hide command prompt when using subprocess.Popen with shell=False on Windows

2017-04-16 Thread Philip Lee
New submission from Philip Lee: First, It is nearly useless for the command prompt to pop up during the running time of subprocess.Popen with shell=False. Second, the popping up command prompt would interrupt users and do bad to user experience of GUI applications. Third, I found QProcess

[issue30077] Support Apple AIFF-C pseudo compression in aifc.py

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Seems the "sowt" compression is not just a no-op operation. Perhaps it should change a byte order. Needed tests and test files for the new compression. -- assignee: -> serhiy.storchaka nosy: +serhiy.storchaka stage: -> patch review

[issue30077] Support Apple AIFF-C pseudo compression in aifc.py

2017-04-16 Thread Xiang Zhang
Changes by Xiang Zhang : -- components: +Library (Lib) -Extension Modules versions: +Python 3.7 -Python 3.6 ___ Python tracker ___

[issue22319] mailbox.MH chokes on directories without .mh_sequences

2017-04-16 Thread R. David Murray
R. David Murray added the comment: If there is a way to resolve the lock issue we can consider it. But (without looking at the code again) I suspect the locking is too deeply embedded in the mbox logic for this to be a safe change. -- ___ Python

[issue19184] dis module has incorrect docs for RAISE_VARARGS

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: May be just provide Python statements that correspond different numbers of parameters? 0 -- ``raise``, 1 -- ``raise TOS``, 2 -- ``raise TOS1 from TOS``. -- nosy: +serhiy.storchaka ___ Python tracker

[issue22319] mailbox.MH chokes on directories without .mh_sequences

2017-04-16 Thread R. David Murray
R. David Murray added the comment: The support. ClawsMail is broken, IMO. -- ___ Python tracker ___ ___

[issue30079] Explain why it is recommended to pass args as a string rather than as a sequence If shell is True

2017-04-16 Thread R. David Murray
R. David Murray added the comment: Woops, cut and paste error, there should have been an "echo $2" line in that script as well. -- ___ Python tracker

[issue30079] Explain why it is recommended to pass args as a string rather than as a sequence If shell is True

2017-04-16 Thread R. David Murray
R. David Murray added the comment: Note the subtlety here on unix: rdmurray@pydev:~/python/p36[3.6]>cat temp.sh #!/bin/bash echo $0 echo $1 >>> subprocess.call(['./temp.sh', 'spam', 'eggs'], shell=True) ./temp.sh 0 >>> subprocess.call(['./temp.sh $0 $1', 'spam', 'eggs'], shell=True)

[issue22319] mailbox.MH chokes on directories without .mh_sequences

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Do you mean rejecting the support of Claws Mail IMAP-cache folder or just the patch? -- ___ Python tracker ___

[issue30081] Inconsistent handling of failure of PyModule_AddObject

2017-04-16 Thread Xiang Zhang
Xiang Zhang added the comment: Ohh, I am not alone. :-) -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Change weird behavior of PyModule_AddObject() ___ Python tracker

[issue29902] copy breaks staticmethod

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If add just warnings we are free to add any warnings in 2.7 in Py3k compatible mode (option -3). -- ___ Python tracker

[issue30081] Inconsistent handling of failure of PyModule_AddObject

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue26868 and issue26871. There is also a thread on Python-Dev. -- nosy: +serhiy.storchaka ___ Python tracker

[issue30081] Inconsistent handling of failure of PyModule_AddObject

2017-04-16 Thread Xiang Zhang
New submission from Xiang Zhang: The doc of PyModule_AddObject()[1] states it steals a reference to *value*. But this is only the case when it succeed. On failure the reference is not stolen. The usages of it across the code base are inconsistent. Some realizes this situation and depends on

[issue22319] mailbox.MH chokes on directories without .mh_sequences

2017-04-16 Thread R. David Murray
R. David Murray added the comment: Honestly, given the open questions my inclination would be to reject this. -- ___ Python tracker ___

[issue29902] copy breaks staticmethod

2017-04-16 Thread Barry A. Warsaw
Barry A. Warsaw added the comment: I'd be very hesitant to add anything to 2.7 that changes (even broken) behavior here. It might make more sense to backport the more strict checks to 3.5. OTOH, we can save people from all programming errors, and if warnings are basically ignored (plus,

[issue30080] Add the --duplicate option for timeit

2017-04-16 Thread Armin Rigo
Changes by Armin Rigo : -- nosy: -arigo ___ Python tracker ___ ___

[issue30070] Fix errors handling in the parser module

2017-04-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue30065] Insufficient validation in _posixsubprocess.fork_exec()

2017-04-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

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

2017-04-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

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

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 8e5b52a8da07e781bda50ba0a7065b1058495a37 by Serhiy Storchaka in branch '3.6': bpo-30017: Allowed calling the close() method of the zip entry writer object (#1041) (#1092)

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 49a905958ffc2fcd5d1d1a293ae453d45deeb884 by Serhiy Storchaka in branch '3.5': [3.5] bpo-29943: Do not replace the function PySlice_GetIndicesEx() with a macro (#1049)

[issue30022] Get rid of using EnvironmentError and IOError

2017-04-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue30022] Get rid of using EnvironmentError and IOError

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0 by Serhiy Storchaka in branch 'master': bpo-30022: Get rid of using EnvironmentError and IOError (except test… (#1051) https://github.com/python/cpython/commit/55fe1ae9708d81b902b6fe8f6590e2a24b1bd4b0

[issue10076] Regex objects became uncopyable in 2.5

2017-04-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue10076] Regex objects became uncopyable in 2.5

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset fdbd01151dbd5feea3e4c0316d102db3d2a2a412 by Serhiy Storchaka in branch 'master': bpo-10076: Compiled regular expression and match objects now are copyable. (#1000)

[issue29943] PySlice_GetIndicesEx change broke ABI in 3.5 and 3.6 branches

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 89f9eb5b192b875c017d37cac16bd514aad9a801 by Serhiy Storchaka in branch '2.7': bpo-29943: Remove the PySlice_GetIndicesEx() macro. (#1050) https://github.com/python/cpython/commit/89f9eb5b192b875c017d37cac16bd514aad9a801 --

[issue29838] Check that sq_length and mq_length return non-negative result

2017-04-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex

2017-04-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker

[issue29839] Avoid raising OverflowError in len() when __len__() returns negative large value

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > The doc does not specify that 'length' cannot be non-negative. It does. https://docs.python.org/3/reference/datamodel.html#object.__len__ .. method:: object.__len__(self) Called to implement the built-in function :func:`len`. Should return the length

[issue28765] _sre.compile(): be more strict on types of indexgroup and groupindex

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset cd85d0b90b39310c8ca7329bd35e82c2c1c8f4ad by Serhiy Storchaka in branch 'master': bpo-28765: Use concrete types API in _sre.c. (#1009) https://github.com/python/cpython/commit/cd85d0b90b39310c8ca7329bd35e82c2c1c8f4ad --

[issue29839] Avoid raising OverflowError in len() when __len__() returns negative large value

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset baf9f29811dba9c06e76b8e220bd77260202f299 by Serhiy Storchaka in branch 'master': bpo-29839: Raise ValueError rather than OverflowError in len() for negative values. (#701)

[issue29902] copy breaks staticmethod

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What are your thoughts Barry? staticmethod, classmethod and property objects are incorrectly pickled in 2.7 and 3.5 (they are not pickleable in 3.6+). Making them not pickleable in 2.7 and 3.5 can help to catch programming errors. But this can break the

[issue22319] mailbox.MH chokes on directories without .mh_sequences

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Ping. -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue29838] Check that sq_length and mq_length return non-negative result

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New changeset 813f943c592cf225871b99cffc99304c8cbbee40 by Serhiy Storchaka in branch 'master': bpo-29838: Add asserts for checking results of sq_length and mq_length slots. (#700)

[issue30080] Add the --duplicate option for timeit

2017-04-16 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- pull_requests: +1290 ___ Python tracker ___ ___

[issue30080] Add the --duplicate option for timeit

2017-04-16 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: One of the most used by me option of the "perf timeit" subcommand is --duplicate. It duplicates statements to reduce the overhead of the loop. This is necessary when measure the time of very fast statements. Proposed patch adds this option for CLI of the