[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: The plain-insert-followed-by-a-pop-on-the-right is giving reasonable results with nice properties: d.insert(0, i) --- 0 --> deque([0], maxlen=4) 1 --> deque([1, 0], maxlen=4) 2 --> deque([2, 1, 0], maxlen=4) 3 --> deque([3, 2,

[issue26039] More flexibility in zipfile interface

2016-01-26 Thread Thomas Kluyver
Thomas Kluyver added the comment: Serhiy, any chance you'd have some time to review my patch(es)? Or is there someone else interested in zipfile I might interest? Thanks :-) -- ___ Python tracker _

[issue24683] Type confusion in json encoding

2016-01-26 Thread paul
paul added the comment: Proof of EIP control. -- Added file: http://bugs.python.org/file41719/eip.py ___ Python tracker ___ ___ Python

[issue24683] Type confusion in json encoding

2016-01-26 Thread paul
paul added the comment: GDB dump of running ./python eip.py ___ eax:37A317DD ebx:B7A54268 ecx:BFFFE22C edx:11223344 eflags:00010217 esi:B7A61060 edi:B7AA6714 esp:BFFFE20C ebp:B7A317DC eip:11223344

[issue26206] test_socket.testRecvmsgPeek() timeout on "AMD64 Debian root 3.x" buildbot

2016-01-26 Thread STINNER Victor
New submission from STINNER Victor: The bug started between build 3071 and 3072: * http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.x/builds/3071 * http://buildbot.python.org/all/builders/AMD64%20Debian%20root%203.x/builds/3072 Maybe it's an issue on the buildbot, not on the c

[issue26206] test_socket.testRecvmsgPeek() timeout on "AMD64 Debian root 3.x" buildbot

2016-01-26 Thread STINNER Victor
STINNER Victor added the comment: Info about the buildbot (regrtest headers): == CPython 3.6.0a0 (default:fadc4b53b840, Jan 26 2016, 18:14:53) [GCC 4.7.2] == Linux-3.2.0-4-amd64-x86_64-with-debian-7.9 little-endian == hash algorithm: siphash24 64bit == /root/buildarea/3.x.angelico-debian-a

[issue26206] test_socket.testRecvmsgPeek() timeout on "AMD64 Debian root 3.x" buildbot

2016-01-26 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +Rosuav ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-26 Thread STINNER Victor
New submission from STINNER Victor: It looks like the buildbot started to fail with the build http://buildbot.python.org/all/builders/AMD64%20Windows7%20SP1%203.x/builds/7166/ The change 37dc870175be43cdcb6920cc642a99fc10cd4bb4 of issue #25850 changed Lib/distutils/_msvccompiler.py: "Use cross

[issue25850] Building extensions with MSVC 2015 Express fails

2016-01-26 Thread STINNER Victor
STINNER Victor added the comment: test_distutils is now failing on "AMD64 Windows7 SP1 3.x" buildbot: please see issue #26207. -- nosy: +haypo ___ Python tracker ___ ___

[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-26 Thread STINNER Victor
STINNER Victor added the comment: Same issue on Windows 8 and Windows 10 buildbots: * http://buildbot.python.org/all/builders/AMD64%20Windows8%203.x/builds/1716/steps/test/logs/stdio * http://buildbot.python.org/all/builders/AMD64%20Windows10%203.x/builds/598/steps/test/logs/stdio --

[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-26 Thread Jeremy Kloth
Changes by Jeremy Kloth : -- nosy: +jkloth ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.

[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Proposed patch fixes minor bugs in Python/getargs.c: 1. Replaces TypeError with confusing error message for buffer overflow for "es#" and "et#" format units to ValueError with correct error message. Due to the risk to break working code, may be we will left

[issue26039] More flexibility in zipfile interface

2016-01-26 Thread Thomas Kluyver
Thomas Kluyver added the comment: Thanks! I will work on docs and tests. -- ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue26039] More flexibility in zipfile interface

2016-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Your patches are great Thomas! This is just what I want to implement. It will take some time to make a careful review. Besides possible corrections I think these features will be added in 3.6. But new features need tests and documenting. -- assignee

[issue26198] PyArg_ParseTuple with format "et#" and "es#" detects overflow by raising TypeError instead of ValueError

2016-01-26 Thread Hrvoje Nikšić
Hrvoje Nikšić added the comment: Barun, Serhiy, thanks for picking this up so quickly. I would further suggest to avoid using a fixed buffer in abspath (_getfullpathname, but only abspath seems to call it). Other filesystem calls are using the interface where PyArg_ParseTuple allocates the buf

[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-26 Thread Steve Dower
Steve Dower added the comment: So the more interesting error message is higher up: xxmodule.c xxmodule.obj : warning LNK4197: export 'PyInit_xx' specified multiple times; using first specification Creating library d:\temp\tmptzty591d\Debug\temp\tmptzty591d\xx_d.cp36-win_amd64.lib and object

[issue19698] Implement _imp.exec_builtin and exec_dynamic

2016-01-26 Thread Brett Cannon
Brett Cannon added the comment: At this point both FrozenImporter and BuiltinImporter support exec_module(), so the only thing left to do is to document when FrozenImporter and WindowsRegistryFinder gained their exec_module() implementations (BuiltinImporter already has a note about it).

[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-26 Thread Zachary Ware
Zachary Ware added the comment: Steve, I'm assuming you meant "x86_amd64" rather than "x86_arm" on that last filename? Note that this issue is restricted to Debug builds (as suggested by the issue being with mspdb140.dll), the Non-Debug buildbot is not failing. -- ___

[issue26203] nesting venv in virtualenv segfaults

2016-01-26 Thread Brett Cannon
Changes by Brett Cannon : -- status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue26205] Inconsistency concerning nested scopes

2016-01-26 Thread Brett Cannon
Brett Cannon added the comment: https://docs.python.org/3/tutorial/classes.html for the docs that Roscoe is talking about. So the sentence is technically correct, it just takes careful reading to grasp what's being said. There are "at least three nested scopes", but there can be *up to* four

[issue26208] decimal C module's exceptions don't match the Python version

2016-01-26 Thread Petr Viktorin
New submission from Petr Viktorin: Exceptions from the decimal module are quite unfriendly: >>> Decimal(42) / Decimal(0) ... decimal.DivisionByZero: [] >>> huge = Decimal('9' * 99) >>> huge.quantize(Decimal('0.1')) ... decimal.InvalidOperation: [] compared to the p

[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-26 Thread Steve Dower
Steve Dower added the comment: Yep, that's what I meant. So many cross compilers these days... -- ___ Python tracker ___ ___ Python-bu

[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-26 Thread STINNER Victor
STINNER Victor added the comment: > It's entirely possible that this was an issue with VS 2015 that has been > resolved in VS 2015 Update 1. Let me check with some people who may know. If a fix cannot be found quickly, would it be possible to revert the Python change until VS is fixed and the

[issue26204] compiler: don't emit LOAD_CONST instructions for constant statements?

2016-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. It looks to me that this optimization was added to avoid spending executing time for docstrings. Other cases almost never occur in real code and are not worth to be optimized. But the patch makes the code cleaner (it would even more cleaner if collaps

[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It would be easier to just temporary skip some tests on particular platforms. -- nosy: +serhiy.storchaka ___ Python tracker ___ __

[issue26208] decimal C module's exceptions don't match the Python version

2016-01-26 Thread Raymond Hettinger
Raymond Hettinger added the comment: If it doesn't take too much effort, I would like the see the exception messages made more user friendly and kept more in-sync with the pure Python version. -- assignee: -> skrah nosy: +rhettinger ___ Python track

[issue26209] TypeError in smtpd module with string arguments

2016-01-26 Thread Lorenzo Ancora
New submission from Lorenzo Ancora: smtpd.PureProxy(localaddr="host1", remoteaddr="host2") ...produces the error: [...] smtpd.py", line 657, in __init__ gai_results = socket.getaddrinfo(*localaddr, type=socket.SOCK_STREAM) TypeError: getaddrinfo() got multiple values for argument 'type' Th

[issue26209] TypeError in smtpd module with string arguments

2016-01-26 Thread SilentGhost
Changes by SilentGhost : -- nosy: +giampaolo.rodola ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue26208] decimal C module's exceptions don't match the Python version

2016-01-26 Thread Stefan Krah
Stefan Krah added the comment: Yes, ideally the exceptions should be in sync. I don't find the list of signals entirely uninteresting, but implementing it in _pydecimal would require #8613 to be solved, which is unlikely to happen. In _decimal the exceptions come directly from libmpdec, so in o

[issue26208] decimal C module's exceptions don't match the Python version

2016-01-26 Thread Stefan Krah
Changes by Stefan Krah : -- stage: -> needs patch type: -> enhancement versions: +Python 3.6 ___ Python tracker ___ ___ Python-bugs-

[issue26210] `HTMLParser.handle_data` may be invoked although `HTMLParser.reset` was invoked

2016-01-26 Thread Yannick Duchêne
New submission from Yannick Duchêne: `HTMLParser.handle_data` may be invoked although `HTMLParser.reset` was invoked. This occurs at least when `HTMLParser.reset` was invoked during `HTMLParser.handle_endtag`. According to the documentation, `HTMLParser.reset` discard all data, so it should i

[issue26201] Faster type checking in listobject.c

2016-01-26 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- Removed message: http://bugs.python.org/msg258942 ___ Python tracker ___ ___ Python-bugs-list mailin

[issue26207] test_distutils fails on "AMD64 Windows7 SP1 3.x" buildbot

2016-01-26 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka added the comment: > It would be easier to just temporary skip some tests on particular platforms. Ah yes, I also like this option. Well, it's up to you Steve :-) -- ___ Python tracker

[issue26211] HTMLParser: “AssertionError: we should not get here!”

2016-01-26 Thread Yannick Duchêne
New submission from Yannick Duchêne: Using HTMLParser on the attached file, I got this: File "/usr/lib/python3.5/html/parser.py", line 111, in feed self.goahead(0) File "/usr/lib/python3.5/html/parser.py", line 171, in goahead k = self.parse_starttag(i) File "/u

[issue26204] compiler: don't emit LOAD_CONST instructions for constant statements?

2016-01-26 Thread STINNER Victor
STINNER Victor added the comment: Serhiy: "It looks to me that this optimization was added to avoid spending executing time for docstrings." Hum, let me dig Mercurial history. changeset: 39364:8ef3f8cf90e1 branch: legacy-trunk user:Neal Norwitz date:Fri Aug 04 05:09

[issue26204] compiler: don't emit LOAD_CONST instructions for constant statements?

2016-01-26 Thread STINNER Victor
STINNER Victor added the comment: """ Will the following code compile OK? What will it compile to? if 1: 42 """ compile OK: what do you mean? This code doesn't make any sense to me :-) Currently text strings statements are ignored: --- >>> def f(): ... if 1: ... "abc" ... >>> im

[issue26205] Inconsistency concerning nested scopes

2016-01-26 Thread Yannick Duchêne
Yannick Duchêne added the comment: Better at least two, if I'm not wrong: the innermost scope may be the module's scope. So there is always at least the module scope and the built‑ins scope, at least two up to four. (if I have not overlooked something) -- nosy: +Hibou57 _

[issue26204] compiler: don't emit LOAD_CONST instructions for constant statements?

2016-01-26 Thread STINNER Victor
STINNER Victor added the comment: Serhiy: "It looks to me that this optimization was added to avoid spending executing time for docstrings. Other cases almost never occur in real code and are not worth to be optimized. But the patch makes the code cleaner (it would even more cleaner if collaps

[issue26205] Inconsistency concerning nested scopes

2016-01-26 Thread Brett Cannon
Changes by Brett Cannon : -- stage: -> needs patch type: behavior -> versions: +Python 2.7, Python 3.6 ___ Python tracker ___ ___ Py

[issue26205] Inconsistency concerning nested scopes

2016-01-26 Thread Brett Cannon
Brett Cannon added the comment: It depends on how you want to view things as to whether you can claim there are two or three scopes for module-level code. While it's true that the local scope operates just like global scope, to Python it's more like local == global rather than the local scope

[issue26204] compiler: don't emit LOAD_CONST instructions for constant statements?

2016-01-26 Thread STINNER Victor
STINNER Victor added the comment: > Maybe the compiler should emit a warning to say that the code doesn't make > sense at all and is ignored? Oh ok, now I recall a similar issue that I posted 3 years ago: issue #17516, "Dead code should be removed". Example of suspicious code: def func():

[issue26204] compiler: ignore constants used as statements? (don't emit LOAD_CONST+POP_TOP)

2016-01-26 Thread STINNER Victor
Changes by STINNER Victor : -- title: compiler: don't emit LOAD_CONST instructions for constant statements? -> compiler: ignore constants used as statements? (don't emit LOAD_CONST+POP_TOP) ___ Python tracker

[issue24905] Allow incremental I/O to blobs in sqlite3

2016-01-26 Thread Aviv Palivoda
Changes by Aviv Palivoda : -- nosy: +palaviv ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue26146] PEP 511: Add ast.Constant to allow AST optimizer to emit constants

2016-01-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset c5df914e73ad by Victor Stinner in branch 'default': Fix a refleak in validate_constant() https://hg.python.org/cpython/rev/c5df914e73ad -- ___ Python tracker _

[issue26146] PEP 511: Add ast.Constant to allow AST optimizer to emit constants

2016-01-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset 0d0d0a05 by Victor Stinner in branch 'default': Issue #26146: remove useless code https://hg.python.org/cpython/rev/0d0d0a05 New changeset 58086f0a953a by Victor Stinner in branch 'default': Issue #26146: enhance ast.Constant error message h

[issue26212] Python with ncurses6.0 will not load _curses module.

2016-01-26 Thread R. Jones
New submission from R. Jones: I am trying to compile Python-2.7.10. This is being done as a user, not root and I don't have access to /usr/local other than to avoid all the broken stuff in it. My local is /appl/local I am installing Python in /appl/local/python-2.7.10 I have ncursest as par

[issue26213] Document BUILD_LIST_UNPACK & BUILD_TUPLE_UNPACK

2016-01-26 Thread Brett Cannon
New submission from Brett Cannon: Turns out the BUILD_TUPLE_UNPACK and BUILD_LIST_UNPACK opcodes are undocumented in the dis module. -- assignee: docs@python components: Documentation messages: 258985 nosy: benjamin.peterson, brett.cannon, docs@python priority: low severity: normal stag

[issue26213] Document BUILD_*_UNPACK opcodes

2016-01-26 Thread Brett Cannon
Brett Cannon added the comment: There are also BUILD_SET_UNPACK and BUILD_MAP_UNPACK as well. -- title: Document BUILD_LIST_UNPACK & BUILD_TUPLE_UNPACK -> Document BUILD_*_UNPACK opcodes ___ Python tracker ___

[issue26039] More flexibility in zipfile interface

2016-01-26 Thread Thomas Kluyver
Changes by Thomas Kluyver : Added file: http://bugs.python.org/file41722/zipinfo-from-file2.patch ___ Python tracker ___ ___ Python-bugs-list

[issue26128] Let the subprocess.STARTUPINFO constructor take arguments

2016-01-26 Thread Martin Panter
Changes by Martin Panter : -- stage: -> needs patch ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue19225] lack of PyExc_BufferError doc

2016-01-26 Thread Martin Panter
Martin Panter added the comment: General approach looks good. I left some review comments. VMSError: I think this is Python 2 only, where it seems to be in a similar situation to WindowsError. According to Issue 16136 it was removed in Python 3.4. But it looks like your patch is against Python

[issue26181] argparse can't handle positional argument after list (help message is wrong)

2016-01-26 Thread Martin Panter
Martin Panter added the comment: I think we should discuss this in the existing reports: Issue 9182: Mention the “--” divider in the documentation and usage as a workaround. Perhaps you could mention your proposal to put positional arguments before the options there. Issue 9338: Change the im

[issue26188] Provide more helpful error message when `await` is called inside non-`async` method

2016-01-26 Thread Martin Panter
Martin Panter added the comment: According to PEP 492, “await” is still allowed to be an ordinary identifier in non-async functions until Python 3.7. Which means you are still allowed to write def oh_hai(): await = "something" The proposed error message would need to be smart enough to dis

[issue26211] HTMLParser: “AssertionError: we should not get here!”

2016-01-26 Thread Xiang Zhang
Xiang Zhang added the comment: Test your html file and can not get the AssertionError. Seems everything works fine. Could you please provide more info? -- nosy: +xiang.zhang ___ Python tracker

[issue26211] HTMLParser: “AssertionError: we should not get here!”

2016-01-26 Thread Xiang Zhang
Xiang Zhang added the comment: After reading Issue26210, I can get the AssertionError when there is a self.reset() in handle_endtag. I don't think it's proper to use reset in the process of parsing. From the samples I find on Web, reset is commonly used to set extra attributes on the parser so

[issue26210] `HTMLParser.handle_data` may be invoked although `HTMLParser.reset` was invoked

2016-01-26 Thread Xiang Zhang
Xiang Zhang added the comment: reset just set some attributes to the initial states and it does not control the parsing process. So reading the gohead function, even if reset is called in handle_endtag and all data are discarded, it is still possible for the process to move forward. -

[issue26212] Python with ncurses6.0 will not load _curses module on Solaris 10

2016-01-26 Thread R. Jones
R. Jones added the comment: Note: This issue is on Solaris 10 using GCC 4.7.2 and the Solaris linker "ld". -- title: Python with ncurses6.0 will not load _curses module. -> Python with ncurses6.0 will not load _curses module on Solaris 10 ___ Python

[issue22625] When cross-compiling, don’t try to execute binaries

2016-01-26 Thread ƦOB COASTN
ƦOB COASTN added the comment: Similar patch used for 3.5 Additionally required: -Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py Programs/_freeze_importlib +Python/importlib_external.h: $(srcdir)/Lib/importlib/_bootstrap_external.py + $(MAKE) Programs/_freeze_im

[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-26 Thread Raymond Hettinger
Changes by Raymond Hettinger : -- resolution: -> fixed status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing lis

[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-26 Thread Roundup Robot
Roundup Robot added the comment: New changeset ce3d47eaeb21 by Raymond Hettinger in branch '3.5': Issue #26194: Fix undefined behavior for deque.insert() when len(d) == maxlen https://hg.python.org/cpython/rev/ce3d47eaeb21 -- nosy: +python-dev ___ Pyt

[issue26194] Undefined behavior for deque.insert() when len(d) == maxlen

2016-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: New behavior looks less surprising to me. Old behavior is even more weird for negative indices: >>> from collections import deque >>> d = deque(range(20), maxlen=10) >>> d deque([10, 11, 12, 13, 14, 15, 16, 17, 18, 19], maxlen=10) >>> d.insert(-3, 'New') >>>

[issue17394] Add slicing support to collections.deque

2016-01-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Synchronized with current sources and added mandatory now braces. -- Added file: http://bugs.python.org/file41723/deque_slices_2.patch ___ Python tracker