[issue24610] Incorrect example Unicode string in docs footnote

2015-07-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. The 2.x docs were fixed in c9bf6e70308e, but this change was lost during merging to 3.x in 3d866579117d. -- components: +Unicode nosy: +ezio.melotti, haypo, serhiy.storchaka stage: - commit review versions: +Python 3.4, Python 3.5

[issue24587] Incorrect tkinter behavior of slave widgets of Button

2015-07-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: Please attach the file to this issue, using the [Browse] button. -- nosy: +serhiy.storchaka, terry.reedy ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24587

[issue24572] IDLE Text Output With ASCII Control Codes Not Working

2015-07-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: To modify what I said, Idle only auto-expands literal tabs entered into an editor window with the Tab key. When one is doing such entry, all key sequences are subject to interception, so this is nothing special. Tabs chars put in a string with '\t' or '\x09'

[issue24595] InteractiveInterpreter always prints to stdout

2015-07-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: To me, this cries out for a public context manager ( believe there is a public one in test.support, or something), so one can write with stdout(ob): print(stuff) I am not sure, though, where the C.M.s should live. -- nosy: +terry.reedy

[issue23220] IDLE does not display \b backspace correctly.

2015-07-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: I closed #24572 as a duplicate of this. It is the same issue except for printing \r instead of \b. These issues are not about responses to keyboard actions when entering text into an Idle editor window. During entry, just about any

[issue24610] Incorrect example Unicode string in docs footnote

2015-07-11 Thread Chris Angelico
Chris Angelico added the comment: Interestingly, the 2.7 docs have this correct already. https://docs.python.org/2.7/reference/expressions.html#id23 -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24610

[issue24610] Incorrect example Unicode string in docs footnote

2015-07-11 Thread Chris Angelico
New submission from Chris Angelico: https://docs.python.org/3/reference/expressions.html#id18 The string \u0327\u0043 does not normalize to the same string as \u00C7, as combining characters are supposed to _follow_ the base character. (Some consoles may happen to display them the same way,

[issue23220] IDLE does not display \b backspace correctly.

2015-07-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Control characters are named control characters because they are control the output device. Different devices have different capabilities and reacts different on the same codes. Windows console, different sorts of Linux terminals and Tk text widget are

[issue24612] not operator expression raising a syntax error

2015-07-11 Thread candide
New submission from candide: Expressions such as a + not b a * not b + not b - not b raise a SyntaxError, for instance : 0 + not 0 File stdin, line 1 0 + not 0 ^ SyntaxError: invalid syntax - not 0 File stdin, line 1 - not 0 ^ SyntaxError: invalid syntax if

[issue24612] not operator expression raising a syntax error

2015-07-11 Thread Steven D'Aprano
Steven D'Aprano added the comment: On Sat, Jul 11, 2015 at 03:23:53PM +, candide wrote: New submission from candide: Expressions such as a + not b a * not b + not b - not b raise a SyntaxError, for instance : 0 + not 0 File stdin, line 1 0 + not 0 ^

[issue24612] not operator expression raising a syntax error

2015-07-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: not not 0 is compiled successful, while + not 0, - not 0, and ~ not 0 are rejected. -- nosy: +benjamin.peterson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24612

[issue23601] use small object allocator for dict key storage

2015-07-11 Thread Julian Taylor
Julian Taylor added the comment: ok I ran it again, but note the machine was under use the full time so the results are likely have no meaning. python perf.py -r -b default /tmp/normal/bin/python3 /tmp/opt/bin/python3 Min: 0.399279 - 0.376527: 1.06x faster Avg: 0.410819 - 0.383315: 1.07x

[issue24611] Compiling Python 2.7.10 Error on Unixware 7.1.4

2015-07-11 Thread Ron Barak
New submission from Ron Barak: I wanted to add Python 2.7 to Unix. I downloaded the sources to the VirtualBox on which the Unix is installed and run ./configure --prefix=/usr \ --enable-shared \ --with-system-expat \ without problems. However, when I try to

[issue24611] Compiling Python 2.7.10 Error on Unixware 7.1.4

2015-07-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka nosy: +serhiy.storchaka stage: - needs patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24611 ___

[issue24611] Compiling Python 2.7.10 Error on Unixware 7.1.4

2015-07-11 Thread R. David Murray
R. David Murray added the comment: unixware is not a platform we support (we don't have a buildbot for it). If you can figure out how to fix this and it isn't disruptive to the codebase, you can submit a patch. -- nosy: +r.david.murray ___ Python

[issue24587] Incorrect tkinter behavior of slave widgets of Button

2015-07-11 Thread Eugene K.
Eugene K. added the comment: File attached -- Added file: http://bugs.python.org/file39895/bug.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24587 ___

[issue24612] not operator expression raising a syntax error

2015-07-11 Thread Stefan Behnel
Stefan Behnel added the comment: Hmm, right. I see your point and also the analogy with yield. I could live with (maybe) giving it a better error message suggesting to use parentheses for clarity and otherwise keeping it a SyntaxError. -- ___

[issue24611] Compiling Python 2.7.10 Error on Unixware 7.1.4

2015-07-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: I think this simple patch should fix the issue. -- keywords: +patch stage: needs patch - patch review Added file: http://bugs.python.org/file39896/issue24611.patch ___ Python tracker rep...@bugs.python.org

[issue24612] not operator expression raising a syntax error

2015-07-11 Thread Stefan Behnel
Stefan Behnel added the comment: It looks like perfectly valid syntax to me and I cannot see why it should be semantically rejected. I disagree that it shouldn't be changed. I think it's a (minor) bug that should eventually get fixed. -- nosy: +scoder

[issue19713] Deprecate various things in importlib thanks to PEP 451

2015-07-11 Thread Petr Viktorin
Changes by Petr Viktorin encu...@gmail.com: -- nosy: +encukou ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue19713 ___ ___ Python-bugs-list mailing

[issue24612] not operator expression raising a syntax error

2015-07-11 Thread Matthew Barnett
Matthew Barnett added the comment: not has a lower priority than unary -; this: not a b is parsed as: not (a b) How would you parse: 0 + not 0 + 0 ? Would it be parsed as: 0 + not (0 + 0) ? Similar remarks could apply to yield: 0 + yield 0 which is also a syntax

[issue24613] array.fromstring Use After Free

2015-07-11 Thread John Leitch
John Leitch added the comment: Attaching patch. -- keywords: +patch Added file: http://bugs.python.org/file39900/arraymodule.c.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24613 ___

[issue24613] array.fromstring Use After Free

2015-07-11 Thread John Leitch
New submission from John Leitch: The Python array.fromstring() method suffers from a use after free caused by unsafe realloc use. The issue is triggered when an array is concatenated to itself via fromstring() call: static PyObject * array_fromstring(arrayobject *self, PyObject *args) {

[issue24567] random.choice IndexError due to double-rounding

2015-07-11 Thread Tim Peters
Tim Peters added the comment: [Raymond] I can't say that I feel good about making everyone pay a price for a problem that almost no one ever has. As far as I know, nobody has ever had the problem. But if we know a bug exists, I think it's at best highly dubious to wait for a poor user to

[issue24379] operator.subscript

2015-07-11 Thread Martin Panter
Martin Panter added the comment: Joe: Have you seen the comments on the code review? See the Review link at the top of the bug thread, or maybe check your spam. -- nosy: +vadmium stage: - patch review ___ Python tracker rep...@bugs.python.org

[issue24379] operator.subscript

2015-07-11 Thread Joe Jevnik
Joe Jevnik added the comment: Ah, I hadn't seen that, I will address those now, sorry about that. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___

[issue23220] Documents input/output effects of how IDLE runs user code

2015-07-11 Thread Martin Panter
Martin Panter added the comment: “run ``import idlelib; idlelib.run`` within a try-except statement”: It might be nice to say what exceptions are expected. My guess is ImportError if Idle or TK is not available, or AttributeError if it is but Idle is not running. “Tk handling of ascii control

[issue24587] Tkinter stacking versus focus behavior on Windows

2015-07-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: The issue is the interaction between stacking and focus. I am pretty sure that this is not a Python bug and that this issue should be closed. I suspect that the behavior is not even a tk bug, but simply how Windows' graphics system work. In any case, the

[issue24613] array.fromstring Use After Free

2015-07-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- assignee: - serhiy.storchaka components: +Extension Modules nosy: +serhiy.storchaka stage: - patch review ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24613

[issue24567] random.choice IndexError due to double-rounding

2015-07-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: See the attached timings. The performance hit isn't bad and the code's beauty isn't marred terribly. Yes, we'll fix it, but no I don't have to feel good about it ;-) -- ___ Python tracker

[issue23220] Documents input/output effects of how IDLE runs user code

2015-07-11 Thread Terry J. Reedy
Terry J. Reedy added the comment: I was thinking AttributeError, as mentioned in the previous sentence. But you are correct that ImportError is possible too. Maybe I should just give the code. try: import idlelib idlelib.run running_idle = True except (ImportError,

[issue24379] operator.subscript

2015-07-11 Thread Joe Jevnik
Joe Jevnik added the comment: updating with the slots change This also adds a ton of test cases -- Added file: http://bugs.python.org/file39902/operator_subscript_pyonly.patch ___ Python tracker rep...@bugs.python.org

[issue24567] random.choice IndexError due to double-rounding

2015-07-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: For shuffle I would write if j i. I think 3.x should be fixed as well as 2.7. And I like Tim's suggestion about import-time patching. -- ___ Python tracker rep...@bugs.python.org

[issue24587] Tkinter stacking versus focus behavior on Windows

2015-07-11 Thread Eugene K.
Eugene K. added the comment: It may not be a pure Python bug, but it's definitely at least a tk bug (which makes it a Python bug as long as tk is the canonical UI package in Python.) Workarounds are nice, but a workaround fixes my specific problem here and now, while leaving unknown numbers

[issue24567] random.choice IndexError due to double-rounding

2015-07-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: [Antoine] If that would give a different sequence of random numbers, I'm not sure that's acceptable in a bugfix release. Raymond can shed a light. You're right. It is not acceptable to give a different sequence of random numbers within a bugfix

[issue24610] Incorrect example Unicode string in docs footnote

2015-07-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1cae77f873af by Benjamin Peterson in branch '3.4': fix normalization example (closes #24610) https://hg.python.org/cpython/rev/1cae77f873af New changeset 0127b0cad5ec by Benjamin Peterson in branch '3.5': merge 3.4 (#24610)

[issue24379] operator.subscript

2015-07-11 Thread Joe Jevnik
Joe Jevnik added the comment: ping: is there anything blocking this? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24379 ___ ___

[issue24567] random.choice IndexError due to double-rounding

2015-07-11 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: -- assignee: - rhettinger ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24567 ___ ___

[issue24567] random.choice IndexError due to double-rounding

2015-07-11 Thread Raymond Hettinger
Raymond Hettinger added the comment: FWIW, here are some variants (with differing degrees of brevity, clarity, and performance): def choice(self, seq): Choose a random element from a non-empty sequence. n = len(seq) i = int(self.random() * n) if i == n:

[issue24567] random.choice IndexError due to double-rounding

2015-07-11 Thread Raymond Hettinger
Changes by Raymond Hettinger raymond.hettin...@gmail.com: Added file: http://bugs.python.org/file39897/choice_timings.txt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24567 ___

[issue23220] Documents input/output effects of how IDLE runs user code

2015-07-11 Thread Martin Panter
Martin Panter added the comment: I wouldn’t say TK ignores carriage returns, though I agree it would be better if Idle stripped them out. Currently I get a glyph displayed for them, similarly to \b. They wouldn’t copy to my clipboard, so I fudged them after pasting here: _ =

[issue24379] operator.subscript

2015-07-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The implementation itself LGTM (nice use of decorator). New feature should be documented. Needed changes in Doc/library/operator.rst and Doc/whatsnew/3.6.rst and the docstring for the subscript class. 'subscript' should be added to __all__. --