[issue28294] HTTPServer server.py assumes sys.stderr != None

2016-09-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: I'm interested to work on a patch for this, if no one started yet. -- ___ Python tracker ___

[issue27942] Default value identity regression

2016-09-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___

[issue28313] ttk Style().configure() overwrites Tk().option_add() Button but not Label

2016-09-29 Thread qubodup
New submission from qubodup: The following code will result in a small label and a big button: from tkinter import * from tkinter.ttk import * root = Tk() root.option_add("*Font", "sans-serif 12") s = Style() s.configure('TButton', font=('courier', 40)) s.configure('TLabel', font=('courier',

[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: > and got a 'TypeError: an integer is required (got type LikeInt)' Right, see #12974 for more on arrays, `__int__` and `__index__`. -- ___ Python tracker

[issue27100] Attempting to use class with both __enter__ & __exit__ undefined yields __exit__ attribute error

2016-09-29 Thread Nick Coghlan
Nick Coghlan added the comment: Due to the expected semantics of AttributeError being relatively precise, changing to a protocol check rather than just changing the order we look up the protocol attributes would also involving changing from AttributeError to TypeError. Since that's a

[issue28199] Compact dict resizing is doing too much work

2016-09-29 Thread INADA Naoki
INADA Naoki added the comment: As written in comment, reusing keys object breaks odict implementation. I think we can't avoid copy for Python 3.6. -- keywords: +patch Added file: http://bugs.python.org/file44888/dictresize.patch ___ Python tracker

[issue28294] HTTPServer server.py assumes sys.stderr != None

2016-09-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: use the logging module instead of sys.stderr -- keywords: +patch Added file: http://bugs.python.org/file44890/issue28294.patch ___ Python tracker

[issue28295] PyUnicode_AsUCS4 doc and impl conflict on exception

2016-09-29 Thread Xiang Zhang
Xiang Zhang added the comment: v2 now adds more tests and change the problematic variable name. -- Added file: http://bugs.python.org/file44889/PyUnicode_AsUCS4_v2.patch ___ Python tracker

[issue28315] incorrect "in ?" output in 'divide' example at "Defining Clean-up Actions" in tutorial

2016-09-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Updated the documentation to use instead of ? I also went through other examples in the page and fixed those too. -- keywords: +patch Added file: http://bugs.python.org/file44885/issue28315.patch ___ Python

[issue27854] Installed 2.7: IDLE Help disabled because help.html is missing

2016-09-29 Thread Ned Deily
Changes by Ned Deily : -- components: +Windows nosy: +paul.moore, steve.dower, tim.golden, zach.ware ___ Python tracker ___

[issue28226] compileall does not support pathlib

2016-09-29 Thread Berker Peksag
Berker Peksag added the comment: > Is there a fix for compileall missing from the patch? No, os.path.* functions have taken care of the conversion, but the output was in the following format: Compiling PosixPath('/tmp/tmp_nfh98lw/_test.py')... I fixed it, added a test for the ddir

[issue28226] compileall does not support pathlib

2016-09-29 Thread Berker Peksag
Changes by Berker Peksag : Added file: http://bugs.python.org/file44887/issue28226_v3.diff ___ Python tracker ___

[issue18378] locale.getdefaultlocale() fails on Mac OS X with default language set to English

2016-09-29 Thread Lawrence Velázquez
Changes by Lawrence Velázquez : -- nosy: +larryv ___ Python tracker ___ ___ Python-bugs-list

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: twouters -> serhiy.storchaka resolution: -> fixed stage: -> resolved status: open -> closed type: -> compile error versions: +Python 2.7 ___ Python tracker

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is the question that I asked Arfrever. -- ___ Python tracker ___ ___

[issue28183] Clean up and speed up dict iteration

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: It looks to me that the patch contain unneeded changes. Some changes don't affect performance, others don't look well justified. Are there benchmarks that confirm the benefit of these changes? -- ___ Python

[issue28278] Make `weakref.WeakKeyDictionary.__repr__` meaningful

2016-09-29 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: I don't recall that the issues discussed here were considered when these classes were added; functionality was the issue at the time. I'm not particularly opposed to adding a more data-ful repr for the weakref-oriented mappings, but I'm not really

[issue28201] dict: perturb shift should be done when first conflict

2016-09-29 Thread INADA Naoki
INADA Naoki added the comment: Could anyone review the patch? I'm starting to #28199. But it must conflict with this patch. -- assignee: -> inada.naoki ___ Python tracker

[issue28289] ImportError.__init__ doesn't reset not specified exception attributes

2016-09-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset dcb39d3ba67a by Serhiy Storchaka in branch 'default': Issue #28289: ImportError.__init__ now resets not specified attributes. https://hg.python.org/cpython/rev/dcb39d3ba67a -- nosy: +python-dev ___

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 6110997dd6e7 by Serhiy Storchaka in branch '3.5': Issue #28258: Fixed build with Estonian locale (python-config and distclean https://hg.python.org/cpython/rev/6110997dd6e7 New changeset 1b9e71f5de83 by Serhiy Storchaka in branch '3.6': Issue

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread STINNER Victor
Changes by STINNER Victor : -- priority: critical -> release blocker ___ Python tracker ___

[issue21879] str.format() gives poor diagnostic on placeholder mismatch

2016-09-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

[issue28313] ttk Style().configure() overwrites Tk().option_add() Button but not Label

2016-09-29 Thread qubodup
qubodup added the comment: Thank you for clarifying, reported at http://core.tcl.tk/tk/tktview/1dde2144bdcc5a93f8724fc1b1b85b19114e42c0 -- ___ Python tracker

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a test. -- Added file: http://bugs.python.org/file44882/test_getiterator.patch ___ Python tracker ___

[issue28228] imghdr does not support pathlib

2016-09-29 Thread Brett Cannon
Brett Cannon added the comment: According to https://www.python.org/dev/peps/pep-0494/#schedule, 2.6.0b2 is due on Sunday. Do you think you will be able to commit this and the other patches for PathLike support by then, Ethan? -- ___ Python tracker

[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-29 Thread Oren Milman
Oren Milman added the comment: Ah, I should have read more about __int__ and __index__ before writing my last reply. So IIUC, this is a somewhat painful issue, which could be resolved by: * #20092 * replacing _PyLong_FromNbInt with PyNumber_Index in: - Objects/longobject.c (as

[issue28183] Clean up and speed up dict iteration

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: Serhiy Storchaka added the comment: > It looks to me that the patch contain unneeded changes. Some changes don't > affect performance, others don't look well justified. Are there benchmarks > that confirm the benefit of these changes? Hum, since I expect

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1e29dca5dc4c by Victor Stinner in branch '3.6': Fix xml.etree.ElementTree.Element.getiterator() https://hg.python.org/cpython/rev/1e29dca5dc4c -- nosy: +python-dev ___ Python tracker

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +serhiy.storchaka ___ Python tracker ___

[issue28295] PyUnicode_AsUCS4 doc and impl conflict on exception

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: In general the patch LGTM. I have small doubt about the name of one variable, and may be worth to add yet few tests. -- ___ Python tracker

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: "Expansion is performed here by shell (spawned by make) itself before arguments are passed to find. So LC_ALL=C must be set as a separate command." Oh. I expected at least "export LANG" somewhere. IMHO it deserves a comment explaining the surprising ";".

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Oh. I expected at least "export LANG" somewhere. IMHO it deserves a comment > explaining the surprising ";". I don't know if export is needed. I see the same behavior with and without export. > Does it work if it's written on two lines? No, it doesn't

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread Ned Deily
Ned Deily added the comment: Even better: Python 3.6.0b1 (v3.6.0b1:5b0ca4ed5e2f, Sep 12 2016, 09:24:46) [GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from xml.etree.ElementTree import Element >>> el =

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: I pushed the first obvious fix to unblock the 3.6 beta 2 release scheduled for next monday. -- priority: release blocker -> ___ Python tracker

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: "LC_ALL=C; find" are you sure for ";"? -- ___ Python tracker ___ ___

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread Dmitry Shachnev
New submission from Dmitry Shachnev: The documentation says that getiterator() still accepts a tag argument, but it does not: >>> from xml.etree.ElementTree import Element >>> el = Element('foo') >>> el.getiterator('bar') Traceback (most recent call last): File "", line 1, in SystemError:

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: The bug seems related to the new FASTCALL calling convention introduced in Python 3.6b1. For an unknown reason, the METH_FASTCALL defined in Modules/clinic/_elementtree.c on _elementtree_Element_iter() seems to be ignored or lost somewhere? -- nosy:

[issue28314] ElementTree: Element.getiterator(tag) broken in 3.6

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: Oh... Modules/_elementtree.c uses a function defined in Modules/clinic/_elementtree.c. It hardcodes flags, whereas flags changed. Maybe the alias should be created differently to avoid such issue in the future? Moreover, obviously, we lack unit tests on this

[issue1703178] link_objects in setup.cfg crashes build

2016-09-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 520ca3652422 by Benjamin Peterson in branch '2.7': build_ext: correctly parse the link_objects user option (closes #1703178) https://hg.python.org/cpython/rev/520ca3652422 New changeset b2f0a31fa441 by Benjamin Peterson in branch '3.5': build_ext:

[issue24274] erroneous comments in dictobject.c

2016-09-29 Thread INADA Naoki
Changes by INADA Naoki : -- keywords: +patch Added file: http://bugs.python.org/file44875/lookdict_unicode_comment.patch ___ Python tracker

[issue28294] HTTPServer server.py assumes sys.stderr != None

2016-09-29 Thread Senthil Kumaran
Senthil Kumaran added the comment: Using logging, instead of sys.stderr would be a welcome change in this module. -- keywords: +easy, needs review nosy: +orsenthil ___ Python tracker

[issue28308] Accelerate 'string'.format(value, ...) by using formatted string literals

2016-09-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Build-out an AST optimizer, moving some functionality out of the peephole optimizer ___ Python tracker

[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2016-09-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- dependencies: +Build-out an AST optimizer, moving some functionality out of the peephole optimizer ___ Python tracker

[issue28311] AIX shared library extension modules installation broken - Python2.7

2016-09-29 Thread Michael Felt
New submission from Michael Felt: issue#25825 is closed - and had python2.7 removed - so, want to mention there is something broken - a long time it would seem on AIX - for building packages after python and ensurepip are installed. Currently trying to pip install mercurial; later a regular

[issue28308] Accelerate 'string'.format(value, ...) by using formatted string literals

2016-09-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: For now using formatted string literals (PEP498) is the fastest way of formatting strings. $ ./python -m perf timeit -s 'k = "foo"; v = "bar"' -- '"{!s} = {!r}".format(k, v)' Median +- std dev: 3.96 us +- 0.17 us $ ./python -m perf timeit -s 'k = "foo";

[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-29 Thread Mark Dickinson
Mark Dickinson added the comment: One comment here: it's not the presence of `__int__` that makes a type integer-like; it's the presence of `__index__`. (Decimal and float both supply `__int__`, but shouldn't be regarded as integer-like, for example.) I'm guessing that we're going to have the

[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2016-09-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: For now using formatted string literals (PEP498) is the fastest way of formatting strings. $ ./python -m perf timeit -s 'k = "foo"; v = "bar"' -- '"%s = %r" % (k, v)' Median +- std dev: 2.27 us +- 0.20 us $ ./python -m perf timeit -s 'k = "foo"; v =

[issue28311] AIX shared library extension modules installation broken - Python2.7

2016-09-29 Thread Michael Felt
Changes by Michael Felt : -- type: compile error -> behavior ___ Python tracker ___ ___

[issue28311] AIX shared library extension modules installation broken - Python2.7

2016-09-29 Thread Michael Felt
Changes by Michael Felt : -- type: -> compile error ___ Python tracker ___ ___

[issue28308] Accelerate 'string'.format(value, ...) by using formatted string literals

2016-09-29 Thread Eric V. Smith
Eric V. Smith added the comment: One thing to be careful of here is that there's one slight difference between how str.format() and f-strings handle indexing of values. f-strings, of course, use normal Python semantics, but str.format() treats indexing by things that don't look like integers

[issue28183] Clean up and speed up dict iteration

2016-09-29 Thread INADA Naoki
INADA Naoki added the comment: recreate patch with different option, since Rietveld doesn't accept dict_iter5.patch -- Added file: http://bugs.python.org/file44876/dict_iter6.patch ___ Python tracker

[issue28310] Mixing yield and return with value is allowed

2016-09-29 Thread Markus Unterwaditzer
New submission from Markus Unterwaditzer: The attached example code raises a SyntaxError in Python 2, but is syntactically valid in Python 3. The return value is ignored and an empty generator is produced. I see no reason for this behavioral change. -- components: Interpreter Core

[issue28309] Accelerate string.Template by using formatted string literals

2016-09-29 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- keywords: +patch Added file: http://bugs.python.org/file44878/faster_template.patch ___ Python tracker

[issue28309] Accelerate string.Template by using formatted string literals

2016-09-29 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: Proposed patch makes string.Template compiling template to formatted string literal. Since for now using formatted string literals is the fastest way of formatting strings, this significantly speeds up Template substitution. $ ./python -m perf timeit -s

[issue28183] Clean up and speed up dict iteration

2016-09-29 Thread INADA Naoki
Changes by INADA Naoki : Added file: http://bugs.python.org/file44879/dict_iter7.patch ___ Python tracker ___

[issue28312] Minor change - more direct hint re: multiple machine sizes and LONG_BIT conflicts

2016-09-29 Thread Michael Felt
New submission from Michael Felt: I have been trying to build (pip install) mercurial - for ages. I kept running into this message: "/opt/include/python2.7/pyport.h", line 887.2: 1506-205 (S) #error "LONG_BIT definition appears wrong for platform (bad gcc/glibc config?)." And - finally,

[issue28277] ./Modules/_io/_iomodule.c build failure on AIX (beta1) while (a2) was fine.

2016-09-29 Thread Michael Felt
Michael Felt added the comment: yes. It is what I did manually. Thanks! -- ___ Python tracker ___ ___

[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2016-09-29 Thread Eric V. Smith
Eric V. Smith added the comment: There isn't a direct mapping between %-formatting and __format__ format specifiers. Off the top of my head, I can think of at least one difference: >>> '%i' % 3 '3' >>> '{:i}'.format(3) Traceback (most recent call last): File "", line 1, in ValueError:

[issue28310] Mixing yield and return with value is allowed

2016-09-29 Thread Xiang Zhang
Xiang Zhang added the comment: `return value` is allowed in a generator to support `yield from'. You can read https://www.python.org/dev/peps/pep-0380 for the entire story. -- nosy: +xiang.zhang resolution: -> not a bug stage: -> resolved status: open -> closed

[issue28183] Clean up and speed up dict iteration

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: dict_iter7.patch LGTM, go ahead. Just dont forget to mention Serhiy Storchaka as the co-author ;-) -- ___ Python tracker

[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: '%s' % x should be translated to f'{x!s}', not to f'{x:s}'. Only %s, %r and %a can be supported. Formatting with %i should left untranslated. Or maybe translate '%r: %i' % (a, x) to f'{a!r}: {"%i" % x}'. It is possible also to introduce special opcodes that

[issue28310] Mixing yield and return with value is allowed

2016-09-29 Thread STINNER Victor
STINNER Victor added the comment: > The return value is ignored and an empty generator is produced. It's not ignored: it is passed in the argument of the StopIterator object. > You can read https://www.python.org/dev/peps/pep-0380 for the entire story. See also the PEP 479 (Change

[issue28183] Clean up and speed up dict iteration

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Please wait until I merge my changes. -- ___ Python tracker ___ ___

[issue23740] http.client request and send method have some datatype issues

2016-09-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thanks for the correction Antti. Yes, this is what I initially meant. This optimization is applicable only if the left argument of % is a literal string and the right argument is a tuple expression. Saying about `'%s' % x` I meant a component of the tuple.

[issue28298] can't set big int-like objects to items in array 'Q', 'L' and 'I'

2016-09-29 Thread Oren Milman
Oren Milman added the comment: You are right about the terminology of course. My bad. Anyway, the bug is not related to __index__ (or nb_index), because the three aforementioned functions are using (in case '!PyLong_Check(v)') PyArg_Parse with the formats 'l' or 'L'. Ultimately, convertsimple

[issue28228] imghdr does not support pathlib

2016-09-29 Thread Berker Peksag
Berker Peksag added the comment: Here's a new patch that addresses Serhiy's comments. Let me know if you need a hand with review and commit these patches this weekend :) -- nosy: +berker.peksag Added file: http://bugs.python.org/file44884/issue28228_v2.diff

[issue28315] incorrect "in ?" output in 'divide' example at "Defining Clean-up Actions" in tutorial

2016-09-29 Thread Viorel Tabara
New submission from Viorel Tabara: At https://docs.python.org/3.5/tutorial/errors.html#defining-clean-up-actions when I'm running the "divide('2', '1')" example I get: File "", line 1, in instead of the documentation output of: File "", line 1, in ? The same message is included with

[issue28315] incorrect "in ?" output in 'divide' example at "Defining Clean-up Actions" in tutorial

2016-09-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___

[issue28315] incorrect "in ?" output in 'divide' example at "Defining Clean-up Actions" in tutorial

2016-09-29 Thread Mariatta Wijaya
Mariatta Wijaya added the comment: Thanks for the report. I agree, it should be instead of ? I'll work on a patch for this :) -- ___ Python tracker ___

[issue28307] Accelerate 'string' % (value, ...) by using formatted string literals

2016-09-29 Thread Antti Haapala
Antti Haapala added the comment: Serhiy, you actually did make a mistake above; `'%s' % x` cannot be rewritten as `f'{x!s}'`, only `'%s' % (x,)` can be optimized... (just try with `x = 1, 2`) -- nosy: +ztane ___ Python tracker

[issue28258] Broken python-config generated with Estonian locale

2016-09-29 Thread Roundup Robot
Roundup Robot added the comment: New changeset 17f2b6b2e24c by Victor Stinner in branch '3.5': Issue #28258: Explain the LC_ALL change in a comment https://hg.python.org/cpython/rev/17f2b6b2e24c New changeset f256bd5b8418 by Victor Stinner in branch '2.7': Issue #28258: Explain the LC_ALL

[issue28313] ttk Style().configure() overwrites Tk().option_add() Button but not Label

2016-09-29 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is not Tkinter issue. Pure Tcl/Tk script shows the same result. If this is a bug (I don't know), this is Tk bug. -- nosy: +serhiy.storchaka resolution: -> third party stage: -> resolved status: open -> closed Added file:

[issue28222] test_distutils fails

2016-09-29 Thread Mariatta Wijaya
Changes by Mariatta Wijaya : -- nosy: +Mariatta ___ Python tracker ___ ___