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

2016-01-27 Thread Yannick Duchêne
Yannick Duchêne added the comment: `reset` is called to stop the parser. If really `reset` should not be called during parser hooks execution, then the documentation should says so and an error should be raised when `reset` is invoked. -- ___ Pytho

[issue26214] textwrap should minimize breaks

2016-01-27 Thread Tuomas Salo
New submission from Tuomas Salo: This code: import textwrap textwrap.wrap("123 123 1234567", width=5) currently* produces this output: ['123', '123 1', '23456', '7'] I would expect the textwrap module to only break words when absolutely necessary. That is, I would have expected i

[issue26214] textwrap should minimize number of breaks in extra long words

2016-01-27 Thread Tuomas Salo
Changes by Tuomas Salo : -- title: textwrap should minimize breaks -> textwrap should minimize number of breaks in extra long words ___ Python tracker ___ __

[issue26214] textwrap should minimize number of breaks in extra long words

2016-01-27 Thread SilentGhost
Changes by SilentGhost : -- nosy: +georg.brandl versions: +Python 3.6 -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing

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

2016-01-27 Thread Yannick Duchêne
Yannick Duchêne added the comment: The documentation says: > Reset the instance. Loses all unprocessed data. How can parsing go ahead with all unprocessed data lost? This is the “Loses all unprocessed data” which made me believe it is to stop it. May be the documentation is unclear. By the wa

[issue17394] Add slicing support to collections.deque

2016-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: Thank you for doing this work. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubs

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

2016-01-27 Thread Xiang Zhang
Xiang Zhang added the comment: Actually it does move forward since in goahead, it first store a "copy" of the initial self.rawdata and use it to control the flow. If you make some change to self.rawdata when parsing, for example call reset, goahead can not feel it. But methods parse_* can. So

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

2016-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: But the postcondition d[i] == newitem is broken if i is negative. >>> d = deque('ABC', maxlen=3) >>> d.insert(-1, None) >>> d deque(['A', None, 'B'], maxlen=3) I would expected ['A', 'B', None]. -- resolution: fixed -> status: closed -> open __

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

2016-01-27 Thread Yannick Duchêne
Yannick Duchêne added the comment: Thanks Xiang, for the clear explanations. So an error should be triggered when `reset` is invoked while it should not. And remains the issue about how to stop the parser: should an exception be raised and caught at an outer invocation level? Something like ra

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

2016-01-27 Thread STINNER Victor
STINNER Victor added the comment: > I would expected ['A', 'B', None]. Hum, it seems consistent with list behaviour, no? >>> x=list("abc") >>> x.insert(-1, "X") >>> x ['a', 'b', 'X', 'c'] -1 is the same than len(x)-1 (2 in this example). deque(['A', None, 'B'], maxlen=3) seems correct to me.

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

2016-01-27 Thread Yannick Duchêne
Yannick Duchêne added the comment: I'm closing this issue, as the the issue http://bugs.python.org/issue26210 is the real one and this one seems to be a variant of the former. -- status: open -> closed ___ Python tracker

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

2016-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: -1 is the position before the last element ('C'). After popping-off extra element the result can be ['A', 'B', None] or ['B', None, 'C']. -- ___ Python tracker _

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

2016-01-27 Thread Martin Panter
Martin Panter added the comment: A few more details from : * Affects Python 3 but not 2.7. * Offending test case: RecvmsgUDP6Test.testRecvmsgPeek() * Seems to correspond with the buildbot VM’s config recently being rebuilt

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

2016-01-27 Thread Xiang Zhang
Xiang Zhang added the comment: Hmm, I don't know whether I am right or not. Let's wait for a core member to clarify. If I am wrong, I am quite sorry. I don't think invoking reset when parsing should raise an error(and I don't know how to achieve that). When to invoke a subroutine is determined

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

2016-01-27 Thread STINNER Victor
STINNER Victor added the comment: > -1 is the position before the last element ('C'). After popping-off extra > element the result can be ['A', 'B', None] or ['B', None, 'C']. Oh ok :-) Now I'm confused, I don't know what is the expected behaviour :-) -- __

[issue9694] argparse required arguments displayed under "optional arguments"

2016-01-27 Thread tony gaetani
Changes by tony gaetani : -- nosy: +tonygaetani ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pyt

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

2016-01-27 Thread Yannick Duchêne
Yannick Duchêne added the comment: > And I don't see how to stop the process either. I just did it with `raise StopIteration`, caught at a proper place (in the procedure which invokes `feed` and `close`), and it seems to be fine, I have no more strange behaviours. At least, I cannot see a clea

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

2016-01-27 Thread Yannick Duchêne
Changes by Yannick Duchêne : -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue26098] PEP 510: Specialize functions with guards

2016-01-27 Thread STINNER Victor
STINNER Victor added the comment: Patch version 5: implement PyFunction_RemoveSpecialized() and PyFunction_RemoveAllSpecialized() functions (with unit tests!). I'm not sure that PyFunction_RemoveSpecialized() must return 0 (success) if the removed specialized code doesn't exist (invalid index)

[issue26215] remove gc from CPython

2016-01-27 Thread yuriy_levchenko
New submission from yuriy_levchenko: I permanently use gc.disable() but CPython create object with GC_Head. it's use big memory. I suggest add define to a few file that remove use GC_Head and allocate extra memory. -- messages: 259013 nosy: yuriy_levchenko priority: normal severity: nor

[issue26215] remove gc from CPython

2016-01-27 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python

[issue24841] Some test_ssl network tests fail if svn.python.org is not accessible.

2016-01-27 Thread Martin Panter
Martin Panter added the comment: The two changes to test_ssl.py look okay to me, although they will need updating since the Issue 24841 changeover to pythontest.net. But I don’t think it is a good idea to add ENOTCONN to the list of errors ignored by all transient_internet() tests. In most cas

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

2016-01-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 16f60cd918e0 by Victor Stinner in branch 'default': PEP 511 https://hg.python.org/peps/rev/16f60cd918e0 -- ___ Python tracker ___ _

[issue26107] PEP 511: code.co_lnotab: use signed line number delta to support moving instructions in an optimizer

2016-01-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 16f60cd918e0 by Victor Stinner in branch 'default': PEP 511 https://hg.python.org/peps/rev/16f60cd918e0 -- ___ Python tracker ___ _

[issue25843] code_richcompare() don't use constant type when comparing code constants

2016-01-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 16f60cd918e0 by Victor Stinner in branch 'default': PEP 511 https://hg.python.org/peps/rev/16f60cd918e0 -- ___ Python tracker ___ _

[issue26173] test_ssl.bad_cert_test() exception handling

2016-01-27 Thread Martin Panter
Changes by Martin Panter : -- keywords: +patch Added file: http://bugs.python.org/file41725/bad-cert-py3.patch ___ Python tracker ___

[issue25868] test_eintr.test_sigwaitinfo() hangs on "AMD64 FreeBSD CURRENT 3.x" buildbot

2016-01-27 Thread Martin Panter
Martin Panter added the comment: (Wrote this ages ago but never hit send:) Here is another theory to explain the hang: When sigwaitinfo() is being called, and the SIGALRM signal arrives, it executes the signal handler (both the C handler and later the Python handler). If the SIGUSR1 signal arr

[issue26182] Deprecation warnings for the future async and await keywords

2016-01-27 Thread Anish Shah
Changes by Anish Shah : -- nosy: +anish.shah ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.pytho

[issue25702] Link Time Optimizations support for GCC and CLANG

2016-01-27 Thread Alecsandru Patrascu
Alecsandru Patrascu added the comment: As Steve mentioned, the Microsoft compiler uses LTO (they call it Link-Time Code Generation) and the flags are used when compiling CPython on Windows systems. Thus our proposal to enable it on GCC and CLANG also. -- __

[issue25314] Documentation: argparse's actions store_{true, false} default to False/True (undocumented)

2016-01-27 Thread Julien Baley
Julien Baley added the comment: This issue has now been open for nearly three months. I think my patch is an improvement over the current documentation. If people want to improve the documentation further, they can probably submit a patch for that. What can I do to get this accepted?

[issue26216] run runtktests.py error when test tkinter

2016-01-27 Thread allensll
New submission from allensll: When I run the following: python ...\Python35\Lib\tkinter\test\runtktests.py Error: SystemError: Parent module 'tkinter.test' not loaded, cannot perform relative import When I add "import tkinter.test" into runtktests.py,it's working. -- components: Tkinter

[issue1528593] Printing: No print dialog or page setup

2016-01-27 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- nosy: -gpolo, kbk versions: +Python 3.5, Python 3.6 -Python 3.2 ___ Python tracker ___ ___ Python-bu

[issue26039] More flexibility in zipfile interface

2016-01-27 Thread Thomas Kluyver
Thomas Kluyver added the comment: The '2' versions of the two different patches include some docs and tests for these new features. -- Added file: http://bugs.python.org/file41726/zipfile-open-w2.patch ___ Python tracker

[issue19225] lack of PyExc_BufferError doc

2016-01-27 Thread Gedai Tamás Bence
Gedai Tamás Bence added the comment: Thanks Martin for the review! I tried to fix the problems, I hope now it'll be good. Changes: - fixed uppercase 'B' - removed VMSError - moved notes after versionchanged - added two indices for the different tables * put BufferError in it's place I didn't f

[issue26217] Fatal error when importing ``test.test_os`` in debug mode on Windows

2016-01-27 Thread Emanuel Barry
New submission from Emanuel Barry: I compiled CPython from latest trunk on GitHub (revision a587bc1eea903dfac94a85324cc6ab39755769a8), compiled with Py_DEBUG and went to run the test suite. Here's the (rather long) output: E:\GitHub\cpython\PCbuild\win32>python_d -m test == CPython 3.6.0a0 (de

[issue26217] Fatal error when importing ``test.test_os`` in debug mode on Windows

2016-01-27 Thread Emanuel Barry
Emanuel Barry added the comment: This fixed it, thanks! -- stage: -> patch review ___ Python tracker ___ ___ Python-bugs-list mailing

[issue26217] Fatal error when importing ``test.test_os`` in debug mode on Windows

2016-01-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 8de6f19afc86 by Victor Stinner in branch '3.5': Fix resize_compact() https://hg.python.org/cpython/rev/8de6f19afc86 -- nosy: +python-dev ___ Python tracker ___

[issue26217] Fatal error when importing ``test.test_os`` in debug mode on Windows

2016-01-27 Thread STINNER Victor
STINNER Victor added the comment: Hum, it looks like resize_compact() clears wstr, but don't reset wstr_length to 0. Attached patch should fix that. -- keywords: +patch nosy: +haypo Added file: http://bugs.python.org/file41728/wstr_len.patch ___ Pyth

[issue26218] Set PrependPath default to true

2016-01-27 Thread Wallison Resende Santos
New submission from Wallison Resende Santos: Please, set the PrependPath configuration to true. It's a good option for console developers on windows. -- components: Installation messages: 259028 nosy: Wallison Resende Santos priority: normal severity: normal status: open title: Set Prep

[issue26217] Fatal error when importing ``test.test_os`` in debug mode on Windows

2016-01-27 Thread Emanuel Barry
Changes by Emanuel Barry : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___ ___

[issue26218] Set PrependPath default to true

2016-01-27 Thread Bruno Salvino
Bruno Salvino added the comment: Please, set the PrependPath configuration to true. -- nosy: +Bruno Salvino ___ Python tracker ___ ___

[issue25868] test_eintr.test_sigwaitinfo() hangs on "AMD64 FreeBSD CURRENT 3.x" buildbot

2016-01-27 Thread STINNER Victor
STINNER Victor added the comment: > This would also be avoided by blocking SIGUSR1. Sorry, I'm lost on this old and complex issue. Can you please propose a patch? If it doesn't break test_eintr on Linux and FreeBSD, we can just push it and take a look sometimes at FreeBSD buildbots ;-) ---

[issue26182] Deprecation warnings for the future async and await keywords

2016-01-27 Thread Guido van Rossum
Changes by Guido van Rossum : -- nosy: -gvanrossum ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mai

[issue20120] Percent-signs (%) in .pypirc should not be interpolated

2016-01-27 Thread R. David Murray
R. David Murray added the comment: So fixing distutils to use RawConfigParser? How likely is that to break currently working python3-only code? I'm imagining from what you wrote that your answer is "very close to zero', but I'd like explicit confirmation :) -- __

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-01-27 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- versions: -Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-01-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: Ouch. Moving the idleConf import was a blunder. It disabled printing in 2.7.11, 3.4.4, and 3.5.1. When I revert, I will also augment the htest to test the printing and save-as functions. Still have to remember to run it though. This sort of functional test

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-01-27 Thread Roundup Robot
Roundup Robot added the comment: New changeset 34ca24fa1b4a by Terry Jan Reedy in branch '2.7': Issue #25507: revert incorrect movement of idleConf import in a37ea1d56e98. https://hg.python.org/cpython/rev/34ca24fa1b4a New changeset 86105a109830 by Terry Jan Reedy in branch '3.5': Issue #25507:

[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov
Changes by Yury Selivanov : -- assignee: yselivanov components: Interpreter Core nosy: yselivanov priority: normal severity: normal stage: patch review status: open title: implement per-opcode cache in ceval type: performance versions: Python 3.6 ___

[issue26220] Unicode HOWTO references a question mark that isn't in snippet

2016-01-27 Thread Quentin Pradet
New submission from Quentin Pradet: >From https://docs.python.org/3.6/howto/unicode.html#the-string-type: > The following examples show the differences:: > > >>> b'\x80abc'.decode("utf-8", "strict") #doctest: +NORMALIZE_WHITESPACE > Traceback (most recent call last): > ... >

[issue25675] doc for BaseEventLoop.run_in_executor() says its a coroutine, but it is not

2016-01-27 Thread Ian Kelly
Ian Kelly added the comment: The asyncio docs also have this note, so this is technically not a bug: Note: In this documentation, some methods are documented as coroutines, even if they are plain Python functions returning a Future. This is intentional to have a freedom of tweaking the impleme

[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread Ian Kelly
New submission from Ian Kelly: I was playing around with this class for adapting regular iterators to async iterators using BaseEventLoop.run_in_executor: import asyncio class AsyncIteratorWrapper: def __init__(self, iterable, loop=None, executor=None): self._iterator = iter(iter

[issue26222] Missing code in linux_distribution python 2.7.11

2016-01-27 Thread Rasmus Rynning Rasmussen
New submission from Rasmus Rynning Rasmussen: During the transition from python 2.7.10 to 2.7.11 some code seems to have been lost. platform.linux_distribution() is not able to recognise Debian based distributions in python 2.7.11. The following code was present in platform.py, python 2.7.10,

[issue10401] Globals / builtins cache

2016-01-27 Thread INADA Naoki
Changes by INADA Naoki : -- nosy: +naoki ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.or

[issue26182] Deprecation warnings for the future async and await keywords

2016-01-27 Thread Brett Cannon
Brett Cannon added the comment: If someone wants to try and fix this, I would look at how the warning for the 'with' statement was handled (it will either be in the compiler while generating bytecode or somewhere in the parser, but I'm fairly certain it's the compiler). -- nosy: +bret

[issue25507] IDLE: user code 'import tkinter; tkinter.font' should fail

2016-01-27 Thread Terry J. Reedy
Terry J. Reedy added the comment: Problem was reported here https://stackoverflow.com/questions/35021370/i-cant-print-from-python-idle-in-windows-10 -- ___ Python tracker ___ __

[issue26215] Make GC_Head a compile-time option

2016-01-27 Thread Brett Cannon
Changes by Brett Cannon : -- title: remove gc from CPython -> Make GC_Head a compile-time option ___ Python tracker ___ ___ Python-bug

[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Brett Cannon
New submission from Brett Cannon: I assume there's going to be a patch or more of a description of what your idea is? :) -- nosy: +brett.cannon ___ Python tracker ___ __

[issue26183] 2.7.11 won't clean install on Windows 10 x64

2016-01-27 Thread Tom Parker
Tom Parker added the comment: FYI, I ran into this same issue, I believe this was caused by my selecting Python tools when installing Visual Studio 2015 Community edition. But I removed it and the issued didn't go away. Then I deleted some empty python registry keys and voila the installer wor

[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread Guido van Rossum
Guido van Rossum added the comment: What are you trying to do here? Can you post a simple example of an iterator that you would like to use with this? Without that it just raises my hackles -- it seems totally wrong to run an iterator in another thread. (Or is the iterator really a coroutine/f

[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov
Yury Selivanov added the comment: Yeah, I needed a URL of the issue for my email to python-dev ;) Here's a link to the email, that explains a lot about this patch: https://mail.python.org/pipermail/python-dev/2016-January/142945.html The patch is also attached (opcache1.patch). -- key

[issue26221] asynco run_in_executor swallows StopIteration

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

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

2016-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: The expected behavior should be "insert normally as if the deque were unbounded and then pop-off the rightmost element to restore the maxlen invariant". The applied fix does that for non-negative indices but gives the wrong result for negative indicies:

[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +haypo, ncoghlan ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://m

[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov
Changes by Yury Selivanov : -- dependencies: +PEP 509: Add ma_version to PyDictObject ___ Python tracker ___ ___ Python-bugs-list mail

[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov
Changes by Yury Selivanov : -- dependencies: +Speedup method calls 1.2x ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Eric V. Smith
Eric V. Smith added the comment: Agreed. And, since any API change would just be a 3.6+ change, this would increase the difficulty of moving between 2.7 and 3.x. Which is not something we want. -- ___ Python tracker

[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov
Yury Selivanov added the comment: > If you run hg.python.org/benchmarks on Linux it has a flag to measure memory. Great. I'll re-run the benchmarks. BTW, the latest results are here: https://gist.github.com/1st1/aed69d63a2ff4de4c7be -- ___ Python

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Serge Stroobandt
Serge Stroobandt added the comment: @rhettinger I completely agree with not creating a backward incompatibility at this point in time. The real issue is that decimal.to_eng_string() was written to a (unfortunately chosen) proprietary specification which does not entirely correspond to the eng

[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread Ian Kelly
Ian Kelly added the comment: The idea is that the wrapped iterator is something potentially blocking, like a database cursor that doesn't natively support asyncio. Usage would be something like this: async def get_data(): cursor.execute('select * from stuff') async for row in AsyncIte

[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread Guido van Rossum
Guido van Rossum added the comment: StopIteration has a special meaning. Don't use set_exception() with it. You probably need a more roundabout way to do this. Instead of submitting each __next__() call to the executor separately, you should submit something to the executor that pulls the item

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

2016-01-27 Thread Tim Peters
Tim Peters added the comment: I'd raise an exception when trying to insert into a bounded deque that's already full. There's simply no way to guess what was _intended_; it's dead easy for the user to implement what they _do_ intend (first make room by deleting the specific item they no longer

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Serge Stroobandt
New submission from Serge Stroobandt: In https://docs.python.org/2/library/string.html#formatstrings the proprietary (IBM) specifcation "Decimal Arithmetic Specification" http://www.gobosoft.com/eiffel/gobo/math/decimal/daconvs.html is incorrectly being heralded as "the" specifiaction for engi

[issue26108] Calling PyInitialize with 2.7.11 on Windows x64 terminates process

2016-01-27 Thread David Heffernan
David Heffernan added the comment: Thanks for following up Steve, and thanks for changing resolution to dupe. As for 3.5 and embedding the docs are much the same as 2.7 in that the example code at https://docs.python.org/3/extending/embedding.html doesn't explicitly set Python home. Anyway,

[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread Ian Kelly
Ian Kelly added the comment: Fair enough. I think there should be some documentation though to the effect that coroutines aren't robust to passing StopIteration across coroutine boundaries. It's particularly surprising with PEP-492 coroutines, since those aren't even iterators and intuitively

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread SilentGhost
Changes by SilentGhost : -- versions: +Python 3.6 -Python 2.7 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: h

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

2016-01-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: What if implement the bahavior described by Raymond for index -len(d) <= i < len(d), but raise an exception if the index is out of this range? The result of deque('abc', maxlen=3).insert(i, 'X') would be: -4: error -3: ['X', 'a', 'b'] -2: ['a', 'X', 'b'] -1:

[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov
Yury Selivanov added the comment: BTW, there are a couple of unit-tests that fail. Both can be easily fixed. To really move this thing forward, we need to profile the memory usage. First, it would be interesting to see how much additional memory is consumed if we optimize every code object.

[issue26183] 2.7.11 won't clean install on Windows 10 x64

2016-01-27 Thread Tom Parker
Tom Parker added the comment: Ah OK :) I had done a W10 reset to wipe my PC before reinstalling VS so I could't imagine where else the python registry keys could have come from. My install sequence was: SQL Server 2012 Developer Visual Studio 2015 Community Edition Office 365 Inkscape - maybe?

[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Brett Cannon
Brett Cannon added the comment: If you run hg.python.org/benchmarks on Linux it has a flag to measure memory. -- ___ Python tracker ___ __

[issue26215] Make GC_Head a compile-time option

2016-01-27 Thread STINNER Victor
STINNER Victor added the comment: Could you please try to elaborate a little bit the issue? > I permanently use gc.disable() but CPython create object with GC_Head. it's use big memory. You propose to remove GC_Head for everywhere? Or do you want a configure option? What do you mean by "big me

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Serge Stroobandt
Serge Stroobandt added the comment: An emphasized version of the exact quote is here now: http://stackoverflow.com/a/35045233/2192488 -- ___ Python tracker ___ __

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

2016-01-27 Thread Tim Peters
Tim Peters added the comment: My opinion doesn't change: I'd rather see an exception. I see no use case for inserting "into the middle" of a full bounded queue. If I had one, it would remain trivial to force the specific behavior I intended. -- _

[issue26221] asynco run_in_executor swallows StopIteration

2016-01-27 Thread Guido van Rossum
Guido van Rossum added the comment: Can you suggest a sentence to insert into the docs and a place where to insert it? (As you can imagine I'm pretty blind for such issues myself.) -- ___ Python tracker ___

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: The decimal module strives to exactly follow the spec even when our sensibilities suggest otherwise. Perhaps, we can add a note to the current docs describing the situation. The API itself is a settled issue, that ship sailed a very long time ago (the prob

[issue26224] Add "version added" for documentation of asyncio.timeout for documentation of python 3.4, 3.5, 3.6

2016-01-27 Thread Udi Oron
New submission from Udi Oron: It seems like `asyncio.timeout` is going to be added in 3.4.5, 3.5.2 and 3.6. The current live documentation of python 3.4 and python 3.5.1 does not include a comment regarding it is not yet available in the current released versions of python. The documentation

[issue26223] decimal.to_eng_string() does not implement engineering notation in all cases.

2016-01-27 Thread Stefan Krah
Stefan Krah added the comment: The spec was the only reasonable choice at the time decimal.py was written. Incidentally, it is basically IEEE-754-2008 with arbitrary precision extensions; this isn't surprising since Mike Cowlishaw was on the IEEE committee and wrote the spec at the same time. T

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

2016-01-27 Thread Raymond Hettinger
Raymond Hettinger added the comment: My only aversion to raising an exception is that it goes against the original intent of maxlen as giving an automatic-pop-to-make-room behavior. Rather that introduce a discontinuity, I like the "smoothness" of letting d.insert(len(d), obj) follow the inser

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

2016-01-27 Thread Josh Rosenberg
Josh Rosenberg added the comment: I agree with Tim that arbitrarily deciding that insert should behave more like appendleft is surprising. This really feels like guessing at what the user wants, silently doing something that really isn't predictable. Any of the following seem nicer (not exactl

[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread STINNER Victor
STINNER Victor added the comment: If I understand correctly, this change requires to wait until the PEP 509 is accepted, right? Well, I'm not really suprised, since global cache is mentioned as an use case of the PEP 509, and other global cache patches are mentioned in Prior Art. --

[issue26219] implement per-opcode cache in ceval

2016-01-27 Thread Yury Selivanov
Yury Selivanov added the comment: Yes, this patch depends on PEP 509. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsu

[issue26108] Calling PyInitialize with 2.7.11 on Windows x64 terminates process

2016-01-27 Thread Steve Dower
Steve Dower added the comment: That's true, though if you use the embeddable distribution of Python 3.5 you automatically get the equivalent behavior because of a new option (the "applocal" option in pyvenv.cfg, which is enabled in that distro by default). -- _

[issue26183] 2.7.11 won't clean install on Windows 10 x64

2016-01-27 Thread Steve Dower
Steve Dower added the comment: VS 2015 won't cause this (I also work on that product as my day job, so I know exactly what it does and doesn't do), but the registry corruption probably did. The pip support that's in the 2.7 installer is not the most robust code, and it can easily run into issu

[issue26225] New misleading wording in execution model documenation

2016-01-27 Thread Andrew Barnert
New submission from Andrew Barnert: In #24129, the wording describing class local bindings in 4.2.2 "Resolution of names" was changed for Python 3.4, 3.5, and 3.6. The new version is a lot clearer for classes--but now it's misleading for `exec`/`eval`. --- > Class definition blocks and argume

[issue26225] New misleading wording in execution model documenation

2016-01-27 Thread Andrew Barnert
Changes by Andrew Barnert : -- type: -> enhancement ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://ma

[issue26098] PEP 510: Specialize functions with guards

2016-01-27 Thread STINNER Victor
STINNER Victor added the comment: FIXME: sys.getsizecode(func) doesn't include specialized code and guards. -- ___ Python tracker ___

[issue26226] Various test suite failures on Windows

2016-01-27 Thread Emanuel Barry
Changes by Emanuel Barry : -- stage: -> needs patch versions: +Python 3.6 ___ Python tracker ___ ___ Python-bugs-list mailing list Un

[issue26226] Various test suite failures on Windows

2016-01-27 Thread STINNER Victor
STINNER Victor added the comment: For the test_httpservers failure, can you please try the following commands on your PC? >>> socket.gethostname() 'selma' >>> socket.gethostbyaddr(socket.gethostname()) ('selma', [], ['2a01:e34:ec8d:4c70:3ea9:f4ff:fe65:c0c', 'fe80::3ea9:f4ff:fe65:c0c']) --

[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-27 Thread STINNER Victor
New submission from STINNER Victor: On Windows, socket.gethostbyaddr() must decode the hostname from the ANSI code page, not from UTF-8. See for example this issue: https://bugs.python.org/issue26226#msg259077 Attached patch changes the socket module to decode hostnames from the ANSI code page

[issue26227] Windows: socket.gethostbyaddr(name) fails for non-ASCII hostname

2016-01-27 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch Added file: http://bugs.python.org/file41734/gethostbyaddr_encoding.patch ___ Python tracker ___ _

[issue17394] Add slicing support to collections.deque

2016-01-27 Thread Josh Rosenberg
Josh Rosenberg added the comment: It seems odd to have a slice of a deque return a list. Are there any other examples of non-buffer protocol objects behaving like this in the standard library/built-ins? Only examples I can come up with are mmap objects and ctypes arrays (which are making raw b

  1   2   >