[issue32422] Make OrderedDict can be used for LRU from C

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This is a duplicate of issue28239.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
superseder:  -> Implement functools.lru_cache() using ordered dict

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32422] Make OrderedDict can be used for LRU from C

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Ah, sorry, you use OrderedDict instead of just ordered dict. It should have 
different timing and memory consumption.

--
resolution: duplicate -> 
stage: resolved -> 
status: closed -> open
superseder: Implement functools.lru_cache() using ordered dict -> 

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32422] Make OrderedDict can be used for LRU from C

2017-12-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32360] Save OrderedDict imports in various stdlibs.

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I concur with Raymond. I made the same searching before and have found that 
there are not much opportunities for getting rid of OrderedDict and there are 
even less cases that will get a benefit from this.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32421] Keeping an exception in cache can segfault the interpreter

2017-12-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I concur with Raymond. Supporting non-string tags is a feature of ElementTree 
that is used internally (for comments, etc) and can be used in user code. And 
the C implementation intentionally reproduces this feature.

--
nosy: +eli.bendersky, scoder, serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32420] LookupError : unknown encoding : [0x7FF092395AD0] ANOMALY

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Could you please provide the output as a text instead of a picture?

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32419] Add unittest support for pyc projects

2017-12-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
components: +Library (Lib) -Extension Modules
nosy: +ezio.melotti, michael.foord, rbcollins
versions:  -Python 3.6, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

PR 4988 will break the case 'module.attr.capsule' if 'module.attr' is not a 
module.

--
nosy: +serhiy.storchaka

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26133] asyncio: ugly error related to signal handlers at exit if the loop is not closed explicitly

2017-12-24 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
pull_requests: +4891

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32398] OSX C++ linking workaround in distutils breaks other packages

2017-12-24 Thread Ronald Oussoren

Ronald Oussoren  added the comment:

As I mentioned on the pull request it is not clear to me what the actual issue 
is.

What are the settings for building that cause problems?  In particular, what 
are the compiler/linker related variables in Python's Makefile (and 
_sysconfigdata.py)?

With the currently available information I'm -1 w.r.t accepting the attached 
pull request.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-24 Thread Stefan Behnel

Stefan Behnel  added the comment:

I also consider it an actual feature of ElementTree to allow arbitrary objects 
as its tags, even if it's not one of the most prominent. lxml cannot copy this 
because it is based on C libraries internally, but that shouldn't prevent ET 
from allowing it.

The fact that None tags disappear is also definitely a feature. It's an easy 
way to delete tags from trees without requiring any restructuring.

OTOH, whether an empty string should be serialised in the way the OP shows is 
not so clear. The output is not XML. I can't see any use case for this, but it 
feels like a potential source of bugs. I think it would be better to have the 
serialiser explicitly reject this than letting it silently generate broken 
output.

Not something to change in Py3.6, though.

--
versions: +Python 3.7 -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32390] AIX (xlc_r) compile error with Modules/posixmodule.c: Function argument assignment between types "unsigned long" and "struct fsid_t" is not allowed

2017-12-24 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

> The PPC64 AIX 3.x Python buildbot 
> (http://buildbot.python.org/all/#/builders/10) has been failing upon this 
> same error for over a month.

Michael Felt answered by email:

> Not quite a month: 8 days ago (test 357 was the first with this error). Great 
> suggestion!

Right, f_fsid has been added only few days ago by issue 32143.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2017-12-24 Thread lekma

lekma  added the comment:

> PR 4988 will break the case 'module.attr.capsule' if 'module.attr' is
> not a module.
you are right, but is that a case you would expect in an import
statement?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26133] asyncio: ugly error related to signal handlers at exit if the loop is not closed explicitly

2017-12-24 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset 4f146f9ed133b9ad56d4ee7a653396836af34067 by Andrew Svetlov in 
branch 'master':
bpo-26133: Clear signals list on interpreter finalizing (#5002)
https://github.com/python/cpython/commit/4f146f9ed133b9ad56d4ee7a653396836af34067


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26133] asyncio: ugly error related to signal handlers at exit if the loop is not closed explicitly

2017-12-24 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4892

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26133] asyncio: ugly error related to signal handlers at exit if the loop is not closed explicitly

2017-12-24 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset 5ff5d1167de88eb37265dcaf1396d12617a0ace7 by Andrew Svetlov (Miss 
Islington (bot)) in branch '3.6':
bpo-26133: Clear signals list on interpreter finalizing (GH-5002) (#5003)
https://github.com/python/cpython/commit/5ff5d1167de88eb37265dcaf1396d12617a0ace7


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26133] asyncio: ugly error related to signal handlers at exit if the loop is not closed explicitly

2017-12-24 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.6, Python 3.7 -Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32335] Failed Python build on Fedora 27

2017-12-24 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

I get the same build failure when the following line is commented out in 
Modules/Setup:

_thread _threadmodule.c # low-level threading interface

Can you please attach the full output of the build.

--
nosy: +xdegaye

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32420] LookupError : unknown encoding : [0x7FF092395AD0] ANOMALY

2017-12-24 Thread Kaoru Kitamura

Kaoru Kitamura  added the comment:

The below is the output of error.

:\Users\kitamura>activate tensorflow
パラメーターの書式が違います - [0x7FFD92395AD0]
[0x7FFD8F53DFE0] ANOMALY: meaningless REX prefix used
[0x7FFD8F555A20] ANOMALY: meaningless REX prefix used
[0x7FFD905417D0] ANOMALY: use of REX.w is meaningless (default operand size is 
64)
[0x7FFD90567C60] ANOMALY: use of REX.w is meaningless (default operand size is 
64)
[0x7FFD92395AD0] ANOMALY: meaningless REX prefix used
[0x7FFD8F53DFE0] ANOMALY: meaningless REX prefix used
[0x7FFD8F555A20] ANOMALY: meaningless REX prefix used
[0x7FFD905417D0] ANOMALY: use of REX.w is meaningless (default operand size is 
64)
[0x7FFD90567C60] ANOMALY: use of REX.w is meaningless (default operand size is 
64)
[0x7FFD92395AD0] ANOMALY: meaningless REX prefix used
Fatal Python error: Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding: [0x7FFD92395AD0] ANOMALY

Current thread 0x31ac (most recent call first):
Fatal Python error: Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding: [0x7FFD92395AD0] ANOMALY

Current thread 0x2bd0 (most recent call first):
Fatal Python error: Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding: [0x7FFD92395AD0] ANOMALY

Current thread 0x04a4 (most recent call first):
Fatal Python error: Py_Initialize: can't initialize sys standard streams
LookupError: unknown encoding: [0x7FFD92395AD0] ANOMALY

Current thread 0x2264 (most recent call first):

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32335] Failed Python build on Fedora 27

2017-12-24 Thread Amit Ghadge

Amit Ghadge  added the comment:

build failure output;

--
Added file: https://bugs.python.org/file47347/build_.txt

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32335] Failed Python build on Fedora 27

2017-12-24 Thread Xavier de Gaye

Xavier de Gaye  added the comment:

Your build failure output shows that _threadmodule.c is not compiled and 
therefore the _thread module is missing.

You just need to overwrite the current Modules/Setup file (it is possibly 
corrupted somehow) as suggested at the start of your attached build output and 
then run make again:

$ cp Modules/Setup.dist Modules/Setup
$ make

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32419] Add unittest support for pyc projects

2017-12-24 Thread R. David Murray

R. David Murray  added the comment:

Éric: in python3 if no .py is found but a .pyc is found where the .py is 
expected, it will be imported and run.  This supports sourceless package 
distributions, which is something we only sorta-support :)

The change looks simple enough that it might be worth doing, but I'll leave 
that to the unittest maintainers.  If accepted there should be comments as to 
why a .pyc is being checked for.

--
nosy: +r.david.murray

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32335] Failed Python build on Fedora 27

2017-12-24 Thread Amit Ghadge

Amit Ghadge  added the comment:

It's work and build succeed. Thanks Xavier

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32419] Add unittest support for pyc projects

2017-12-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
stage:  -> test needed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32422] Make OrderedDict can be used for LRU from C

2017-12-24 Thread INADA Naoki

INADA Naoki  added the comment:

Hmm, it seems my implementation is 30% slower when many mishit scenario.
Maybe, dict is faster than OrderedDict about massive insert/discard.  But I 
need to profile it.

On the other hand, GC speed looks about 2x faster as expected.

$ ./python -m perf compare_to master.json patched.json  -G
Slower (5):
- lru_1000_100: 217 ns +- 6 ns -> 302 ns +- 6 ns: 1.39x slower (+39%)
- lru_1_1000: 225 ns +- 4 ns -> 309 ns +- 2 ns: 1.37x slower (+37%)
- lru_100_1000: 114 ns +- 5 ns -> 119 ns +- 1 ns: 1.05x slower (+5%)
- lru_100_100: 115 ns +- 6 ns -> 119 ns +- 1 ns: 1.03x slower (+3%)
- lru_1000_1000: 134 ns +- 6 ns -> 136 ns +- 1 ns: 1.02x slower (+2%)

Faster (4):
- gc(100): 98.3 ms +- 0.3 ms -> 37.9 ms +- 0.2 ms: 2.59x faster (-61%)
- gc(10): 11.7 ms +- 0.0 ms -> 5.10 ms +- 0.02 ms: 2.29x faster (-56%)
- gc(1): 1.48 ms +- 0.02 ms -> 1.04 ms +- 0.01 ms: 1.41x faster (-29%)
- lru_10_100: 149 ns +- 6 ns -> 147 ns +- 2 ns: 1.02x faster (-2%)

--
Added file: https://bugs.python.org/file47348/lru_bench.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32413] Document that locals() may return globals()

2017-12-24 Thread Srinivas Reddy T

Change by Srinivas  Reddy T :


--
keywords: +patch
pull_requests: +4893
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32413] Document that locals() may return globals()

2017-12-24 Thread Srinivas Reddy T

Srinivas  Reddy T  added the comment:

Done. exec(...)'s  documentation covers raymond's comment.

--
nosy: +thatiparthy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5004] socket.getfqdn() doesn't cope properly with purely DNS-based setups

2017-12-24 Thread Christian Heimes

Change by Christian Heimes :


--
nosy: +christian.heimes

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21872] LZMA library sometimes fails to decompress a file

2017-12-24 Thread Shinjo Park

Shinjo Park  added the comment:

Hi, I think I encountered this bug with Ubuntu 17.10 / Python 3.6.3. The same 
error was triggered by Python's LZMA library, while the xz command line tool 
can extract the problematic file. Not sure whether there is the bug in 3.7/3.8. 
I am attaching the problematic archives, they should contain UTF-16LE encoded 
text.

--
nosy: +peremen
versions: +Python 3.6
Added file: https://bugs.python.org/file47349/failed_files_more.zip

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32422] Make OrderedDict can be used for LRU from C

2017-12-24 Thread INADA Naoki

INADA Naoki  added the comment:

I found odict.pop() and odict.popitem() is very inefficient because
it look up key multiple times.
odict seems not optimized well and very slow than dict in some area...

I'll try to optimize it in holidays.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32422] Make OrderedDict can be used for LRU from C

2017-12-24 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Please stop revising every single thing you look at.  The traditional design of 
LRU caches used doubly linked lists for a reason.  In particular, when there is 
a high hit rate, the links can be updated without churning the underlying 
dictionary.

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32384] Generator tests is broken in non-CPython implementation

2017-12-24 Thread Srinivas Reddy T

Change by Srinivas  Reddy T :


--
pull_requests: +4894

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32360] Save OrderedDict imports in various stdlibs.

2017-12-24 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

> * asyncio/base_events.py:  Used for local variable. 
> * email/_header_value_parser.py: Used for local variable.
> * json: Examples (in document and docstring) for keeping order, and json.tool.

All of these modules have active maintainers.  You should create separate 
issues for each one of these and assign to those maintainers.  You don't just 
get to mow down all the other developers.  That isn't how we work together.

In the JSON module, there does need to be an example of how to use 
object_pairs_hook, so you will need to come up with a replacement or an 
additional note explaining in Py3.7 and later, most of the OrderedDict use 
cases have been supplanted by the regular dict.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-24 Thread Gordon P. Hemsley

Gordon P. Hemsley  added the comment:

To be clear, we are talking about the Element class of the ElementTree module, 
which is distinct from the ElementTree class of the same module.

That said, I personally question the implementation decision to represent 
things like treating comments as an Element with a tag of a Comment function. 
The XML standard is pretty clear that neither comments nor processing 
instructions are in fact elements, and I don't see it as a Good Thing that 
arbitrary objects are allowed as the value of tag, unless there is a 
requirement that such objects are subclasses of str.

Note also that the documentation makes no mention of tag being anything other 
than a string. And there is inconsistency with where bytes are supposedly 
allowed (according to the documentation) and where they're actually allowed 
(according to the code). Given this, I think it's hard to say what user code is 
expected to make use of.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32424] Rename copy() to __copy__() in xml.etree.ElementTree.Element Python implementation

2017-12-24 Thread Gordon P. Hemsley

New submission from Gordon P. Hemsley :

Currently, the Python implementation of the Element class in 
xml.etree.ElementTree defines a method called copy() which the C implementation 
does not define, whereas the C implementation defines a __copy__() method (and 
a __deepcopy__() method) which the Python implementation does not define.

Given that the documentation makes no mention of a copy() method and that its 
definition would be masked by a standard import of xml.etree.ElementTree, I 
propose that it be renamed to __copy__() so that copy.copy() can make use of it.

--
components: Library (Lib), XML
messages: 309010
nosy: eli.bendersky, gphemsley, scoder
priority: normal
severity: normal
status: open
title: Rename copy() to __copy__() in xml.etree.ElementTree.Element Python 
implementation
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32425] Allow non-default XML parsers to take advantage of a _parse_whole definition in xml.etree.ElementTree.ElementTree.parse()

2017-12-24 Thread Gordon P. Hemsley

New submission from Gordon P. Hemsley :

Currently, ElementTree.parse() in xml.etree.ElementTree only invokes 
_parse_whole() on the parser if no parser is specified and it falls back to the 
built-in XMLParser.

This has two drawbacks:
* If the built-in XMLParser is specified explicitly, it does not get the 
advantage of using its _parse_whole() method.
* If another XML parser is specified, it does not have the option to define a 
_parse_whole() method.

In both cases, the parser parses in chunks (of 16 KiB), which is potentially 
slower.

I propose allowing any parser to take advantage of _parse_whole() if it has 
defined such a method. (This would also have the benefit of eliminating some 
minor code duplication--two return branches could become one.)

--
components: Library (Lib), XML
messages: 309011
nosy: eli.bendersky, gphemsley, scoder
priority: normal
severity: normal
status: open
title: Allow non-default XML parsers to take advantage of a _parse_whole 
definition in xml.etree.ElementTree.ElementTree.parse()
type: enhancement
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32425] Allow non-default XML parsers to take advantage of a _parse_whole definition in xml.etree.ElementTree.ElementTree.parse()

2017-12-24 Thread Gordon P. Hemsley

Gordon P. Hemsley  added the comment:

Sorry, the chunks are 64 KiB.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32422] Make OrderedDict can be used for LRU from C

2017-12-24 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

FWIW, I'm the original author and designer of this code, so it would have been 
appropriate to assign this to me for sign-off on any proposed changes.

--
assignee:  -> rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29209] Remove old-deprecated ElementTree features

2017-12-24 Thread Gordon P. Hemsley

Change by Gordon P. Hemsley :


--
nosy: +gphemsley

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2017-12-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
pull_requests: +4895

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-24 Thread Gordon P. Hemsley

Gordon P. Hemsley  added the comment:

Issues of potential relevance to this discussion:
* Issue28237 - In xml.etree.ElementTree bytes tag or attributes raises on 
serialization
* Issue5166 - ElementTree and minidom don't prevent creation of not well-formed 
XML

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue17611] Move unwinding of stack for "pseudo exceptions" from interpreter to compiler.

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The main problem was with the frame.f_lineno setter. I have finally solved it 
in PR 5006. It solves also the regression in the with statement mentioned in 
msg307577 (by just restoring the original SETUP_WITH), and some other minor 
issues which I forgot.

Tests for the frame.f_lineno setter are provided in issue32416. I want to 
backport these changes and add new tests in PR 5006 (which allows to catch more 
illegal jumps than the current code), thus a separate issue. PR 2827 and PR 
4682 crash with these tests.

Additionally PR 5006 may fix several issues with stack size calculation. I'll 
add tests later if there are reproducers.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32422] Make OrderedDict can be used for LRU from C

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> FWIW, I'm the original author and designer of this code, so it would have
> been appropriate to assign this to me for sign-off on any proposed changes.

Not me (the C implementation)? ;-)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28239] Implement functools.lru_cache() using ordered dict

2017-12-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


Added file: https://bugs.python.org/file47350/lru_cache-get-del-set-2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28239] Implement functools.lru_cache() using ordered dict

2017-12-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


Added file: https://bugs.python.org/file47351/lru_cache-pop-set-2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28239] Implement functools.lru_cache() using ordered dict

2017-12-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


Added file: https://bugs.python.org/file47352/lru_cache-move_to_end-2.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28239] Implement functools.lru_cache() using ordered dict

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Since this theme has been raised again in issue32422 and old patches no longer 
apply clearly I have updated patches and benchmark results on 64 bit.

$ ./python -m perf timeit -s "from functools import lru_cache; f = 
lru_cache(512)(lambda x: x); a = list(range(500))*100" -- "list(map(f, a))"

Unpatched:Mean +- std dev: 3.03 ms +- 0.02 ms
get-del-set:  Mean +- std dev: 5.73 ms +- 0.04 ms
pop-set:  Mean +- std dev: 4.63 ms +- 0.04 ms
move_to_end:  Mean +- std dev: 3.57 ms +- 0.06 ms


$ ./python -m perf timeit -s "from functools import lru_cache; f = 
lru_cache(512)(lambda x: x); a = list(range(5))" -- "list(map(f, a))"

Unpatched:Mean +- std dev: 6.65 ms +- 0.11 ms
get-del-set:  Mean +- std dev: 15.5 ms +- 0.1 ms
pop-set:  Mean +- std dev: 15.4 ms +- 0.1 ms
move_to_end:  Mean +- std dev: 15.5 ms +- 0.2 ms


All patches cause significant slowdown (around 2.3x) in the case of many misses.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-24 Thread Stefan Behnel

Stefan Behnel  added the comment:

>That said, I personally question the implementation decision to
>represent things like treating comments as an Element with a tag of a
>Comment function. 

This is not going to change.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32414] PyCapsule_Import fails when name is in the form 'package.module.capsule'

2017-12-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-24 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Marking this as closed.

Gordon, thank you for showing an interest in this tracker item.  While fixing 
bugs is of interest, altering long standing intentional design decisions is not 
useful.  The time to do that is before a module is released, not a decade later.

--
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32421] Keeping an exception in cache can segfault the interpreter

2017-12-24 Thread Josh Holland

Change by Josh Holland :


--
nosy: +anowlcalledjosh

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29084] C API of OrderedDict

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset 1b3029ac8370ac76fa9571aef540e10aed0667ff by Serhiy Storchaka in 
branch 'master':
bpo-29084: Exclude C API for OrderedDict from the limited C API. (#4900)
https://github.com/python/cpython/commit/1b3029ac8370ac76fa9571aef540e10aed0667ff


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29084] C API of OrderedDict

2017-12-24 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4896

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32137] Stack overflow in repr of deeply nested dicts

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Could you please take a look at PR 4689 and PR 4812 Raymond? I remember you had 
objections against similar changes and I have small hesitates. What way of 
solving this issue in maintained releases do you prefer?

--
assignee:  -> rhettinger
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30296] Remove unnecessary tuples, lists, sets, and dicts from Lib

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

What will you say Raymond?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32411] Idlelib.browser: stop sorting dicts created by pyclbr

2017-12-24 Thread Cheryl Sabella

Cheryl Sabella  added the comment:

Terry,

In test_browser, would it be a good test if mock_pyclbr_tree was created as 
`mock_pyclbr_tree = {'C0': C0, 'f0': f0}` 
instead of 
`mock_pyclbr_tree = {'f0': f0, 'C0': C0}`?

The reason that I'm asking is that, under 2.7 and 3.3, this dictionary does not 
retain the insertion order, but changes it from (C0, f0) to (f0, C0).  

Or did you just want a test that checks that the line numbers are still in 
order when the code is returned from transform_children?

--
nosy: +csabella

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30722] Tools/demo/redemo.py broken

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The news message is verbose but looks misleading to me. There is nothing 
invalid with usages like getattr(re, 'DOTALL'). It is the same as re.DOTALL, 
and using enums haven't changed this.

--
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32408] Performance regression in urllib.proxy_bypass_environment

2017-12-24 Thread Xiang Zhang

Xiang Zhang  added the comment:

Okay, the real performance is:

time python2 -c 'import urllib; urllib.proxy_bypass_environment("1.1.1.1")'

real0m0.661s
user0m0.654s
sys 0m0.007s

I compile it with a wrong option with the specific GCC version. But still 
really slow comparing to before.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32411] Idlelib.browser: stop sorting dicts created by pyclbr

2017-12-24 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

(f0, C0) is the correct insertion and line number order for the dict that would 
be returned by pyclbr for a fleshed-out file.  After 'sorted' is removed, the 
mock must imitate that.

One could argue that previously, and even now for 3.6, the initial insertion 
order should be 'wrong' to test that format_children sorts the return list.  
But what is the chance that there will ever be an alternate 3.6 (or even later) 
implementation that runs tkinter and therefore might run IDLE but has a dict 
that does not preserve insert order?

I probably should not worry about the dict insert order guarantee being 
rescinded in a future version.  Maybe instead I should just add a comment that 
transform_children depends on iteration order being insert order == line-number 
order.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32421] Keeping an exception in cache can segfault the interpreter

2017-12-24 Thread Nitish

Nitish  added the comment:

What is six.reraise in except block?

--
nosy: +nitishch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32421] Keeping an exception in cache can segfault the interpreter

2017-12-24 Thread Yonatan Zunger

Yonatan Zunger  added the comment:

It's just a clean version of reraise. Part of the six (Py2/Py3
compatibility) library, but pretty useful on its own anyway.

On Sun, Dec 24, 2017 at 8:37 PM, Nitish  wrote:

>
> Nitish  added the comment:
>
> What is six.reraise in except block?
>
> --
> nosy: +nitishch
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32422] Reduce lru_cache memory overhead.

2017-12-24 Thread INADA Naoki

INADA Naoki  added the comment:

> Please stop revising every single thing you look at.  The traditional design 
> of LRU caches used doubly linked lists for a reason.  In particular, when 
> there is a high hit rate, the links can be updated without churning the 
> underlying dictionary.

I don't proposing removing doubly linked list; OrderedDict uses
doubly-linked list too, and I found no problem for most-hit scenario.

On the other hand, I found problem of OrderedDict for most mis hit
scenario.

Now I think lru_cache's implementation is better OrderedDict.
PyODict is slower than lru_cache's dict + linked list because of
historical reason (compatibility with pure Python implemantation.)

So I stop trying to remove lru_cache's own implementation.
I'll try to reduce overhead of lru_cache, by removing GC header
from link node.

--
title: Make OrderedDict can be used for LRU from C -> Reduce lru_cache memory 
overhead.

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29084] C API of OrderedDict

2017-12-24 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:


New changeset d62b7412c18bd5dfa6d7346abfaf8a922818e6db by Serhiy Storchaka 
(Miss Islington (bot)) in branch '3.6':
bpo-29084: Exclude C API for OrderedDict from the limited C API. (GH-4900) 
(#5007)
https://github.com/python/cpython/commit/d62b7412c18bd5dfa6d7346abfaf8a922818e6db


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29084] C API of OrderedDict

2017-12-24 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32422] Reduce lru_cache memory overhead.

2017-12-24 Thread INADA Naoki

Change by INADA Naoki :


--
keywords: +patch
pull_requests: +4897
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32422] Reduce lru_cache memory overhead.

2017-12-24 Thread INADA Naoki

INADA Naoki  added the comment:

PR-5008 benchmark:

$ ./python -m perf compare_to master.json patched2.json -G
Faster (9):
- gc(100): 98.3 ms +- 0.3 ms -> 29.9 ms +- 0.4 ms: 3.29x faster (-70%)
- gc(10): 11.7 ms +- 0.0 ms -> 3.71 ms +- 0.03 ms: 3.14x faster (-68%)
- gc(1): 1.48 ms +- 0.02 ms -> 940 us +- 6 us: 1.57x faster (-36%)
- lru_10_100: 149 ns +- 6 ns -> 138 ns +- 1 ns: 1.08x faster (-8%)
- lru_100_100: 115 ns +- 6 ns -> 108 ns +- 1 ns: 1.07x faster (-6%)
- lru_1000_1000: 134 ns +- 6 ns -> 127 ns +- 1 ns: 1.05x faster (-5%)
- lru_100_1000: 114 ns +- 5 ns -> 108 ns +- 1 ns: 1.05x faster (-5%)
- lru_1000_100: 217 ns +- 6 ns -> 212 ns +- 4 ns: 1.03x faster (-2%)
- lru_1_1000: 225 ns +- 4 ns -> 221 ns +- 5 ns: 1.02x faster (-2%)

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com