[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-10 Thread INADA Naoki

INADA Naoki added the comment:

> Original Raymond's design didn't preserve ordering during deletion.

Original Raymond's pure Python implementation rebuilds index table.
Without it, proving can be very long or infinite loop.
See L89-92 in http://code.activestate.com/recipes/578375/
Strictly speaking, it's worst case is O(n) too.

Raymond's compact dict allocates entry table and index table separately.
I want to allocate them at once, as one memory block.
It makes better cache hit ratio on small dict.

That's why I choose "preserve insertion order" over "compaction".
Since index table and entry table grow at same time, rebuilding
index table and entry table at once makes sense to me.

Anyway, "namespace is ordered" is Python's language spec now.

class C:
a = 1
b = 2
c = 3
del a

In this case, C's namespace should {"b": 2, "c": 3}, not {"c": 3, "b": 2}.

--

___
Python tracker 

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



[issue29526] Documenting format() function

2017-09-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue31415] Add -X option to show import time

2017-09-10 Thread INADA Naoki

Changes by INADA Naoki :


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

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Note that mixed insertion and deletion is worst-case O(n) in current 
implementation.

Original Raymond's design didn't preserve ordering during deletion. It had 
worst-case O(1) for mixed insertion and deletion. I didn't follow the numerous 
discussions about compact dict implementation, but at some point it became 
keeping holes and preserving ordering during deletion. This leads to the need 
of periodical O(n) reallocation for mixed insertion and deletion. Perhaps the 
technical reason of this was the couple relation between C implementation of 
OrderedDict and dict.

--

___
Python tracker 

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



[issue31415] Add -X option to show import time

2017-09-10 Thread INADA Naoki

New submission from INADA Naoki:

I used my local patch to profile import time.  I think it's useful for
3rd party authors.
For example:

./python -Ximportprofile -c 'import traceback'
- _codecs 71 [us]
  - codecs 677 [us]
  - encodings.aliases 412 [us]
- encodings 1688 [us]
- encodings.utf_8 250 [us]
- _signal 120 [us]
- encodings.latin_1 281 [us]
- _weakrefset 301 [us]
  - abc 593 [us]
- io 1032 [us]
  - _locale 100 [us]
- _bootlocale 262 [us]
- errno 165 [us]
  - _stat 73 [us]
- stat 270 [us]
  - genericpath 166 [us]
- posixpath 456 [us]
- _collections_abc 1798 [us]
  - os 3366 [us]
  - _sitebuiltins 221 [us]
  - sitecustomize 408 [us]
  - usercustomize 168 [us]
- site 5019 [us]
  - _operator 104 [us]
- operator 873 [us]
- keyword 177 [us]
  - _heapq 188 [us]
- heapq 399 [us]
- itertools 140 [us]
- reprlib 224 [us]
- _collections 89 [us]
  - collections 3009 [us]
  - _functools 76 [us]
- collections.abc 267 [us]
  - types 592 [us]
  - weakref 499 [us]
- functools 1726 [us]
- enum 894 [us]
  - _sre 97 [us]
- sre_constants 428 [us]
  - sre_parse 849 [us]
- sre_compile 1267 [us]
- copyreg 200 [us]
  - re 3035 [us]
  - token 222 [us]
- tokenize 4660 [us]
  - linecache 6592 [us]
- traceback 10108 [us]

--
components: Interpreter Core
messages: 301858
nosy: inada.naoki
priority: normal
severity: normal
status: open
title: Add -X option to show import time
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



[issue30744] Local variable assignment is broken when combined with threads + tracing + closures

2017-09-10 Thread Nick Coghlan

Nick Coghlan added the comment:

The same way the dis module does: by looking at the names listed in the various 
code object attributes.

If it's listed in co_cellvars, then it's a local variable in the current frame 
that's in a cell because it's part of the closure for a nested function.

If it's listed in co_freevars, then it's a nonlocal closure reference.

Otherwise, it's a regular local variable that just happens to be holding a 
reference to a cell object.

So if all we did was to put the cell objects in the frame.f_locals dict, then 
trace functions that supported setting attributes (including pdb) would need to 
be updated to be cell aware:

def setlocal(frame, name, value):
if name in frame.f_code.co_cellvars or name in frame.f_code.co_freevars:
frame.f_locals[name].cell_contents = value
else:
frame.f_locals[name] = value

However, to make this more backwards compatible, we could also make it so that 
*if* a cell entry was replaced with a different object, then 
PyFrame_LocalsToFast would write that replacement object back into the cell.

Even with this more constrained change to the semantics frame.f_locals at 
function level, we'd probably still want to keep the old locals() semantics for 
the builtin itself - that has lots of string formatting and other use cases 
where having cell objects suddenly start turning up as values would be 
surprising.

--

___
Python tracker 

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



[issue29718] Fixed compile on cygwin.

2017-09-10 Thread Decorater

Decorater added the comment:

Closing this in favor of https://www.python.org/dev/peps/pep-0539/.

--
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



[issue31308] forkserver process isn't re-launched if it died

2017-09-10 Thread Davin Potts

Davin Potts added the comment:

I have two concerns with this:
1) The implicit restart of the forkserver process seems in conflict with the 
zen of making things explicit.
2) This would seem to make forkserver's behavior inconsistent with the behavior 
of things like the Manager which similarly creates its own process for managing 
resources but does not automatically restart that process if it should die or 
become unreachable.  In the case of the Manager, I don't think we'd want it to 
automagically restart anything in these situations so it's not a simple matter 
of enhancing the Manager to adopt similar behavior.

I do appreciate the use cases that would be addressed by having a convenient 
way to detect that a forkserver has died and then restart it.  If the 
forkserver dies, I doubt we really want it to try to restart a potentially 
infinite number of times.

Maybe a better path would be if we had a way to explicitly request that the 
Process trigger a restart of the forkserver, if necessary, but this 
setting/request defaults to False?

--

___
Python tracker 

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



[issue27755] Retire DynOptionMenu with a ttk Combobox

2017-09-10 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
pull_requests: +3482
stage: test needed -> patch review

___
Python tracker 

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



[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-09-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I moved PR3215 to #27755.  So this issue is really closed.

--

___
Python tracker 

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



[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-09-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 4a8b53a2083506ee13ff2eba2c14264f5a7faa91 by Terry Jan Reedy (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-30781: IDLE: Fix help button on configdialog (GH-3238) (#3489)
https://github.com/python/cpython/commit/4a8b53a2083506ee13ff2eba2c14264f5a7faa91


--

___
Python tracker 

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



[issue30780] IDLE: configdialog - add tests for ConfigDialog GUI.

2017-09-10 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
dependencies: +IDLE: Entry tests should delete before insert.

___
Python tracker 

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



[issue31414] IDLE: Entry tests should delete before insert.

2017-09-10 Thread Terry J. Reedy

New submission from Terry J. Reedy:

Test_configdialog 'tests' several integer entry widgets by inserting a digit 
and then checking that the new value was sent to changes.  However, users may 
delete an entry totally and enter a new value.  If we associate an IntVar with 
the entry widget, int('') is called somewhere in the process, which raises.  
(IntVar(root).set('') does not, so the error is somewhere further along.  The 
test should imitate users by delete and insert.

Note: a deeper problem is attaching a tracer that get called with each 
keystroke.  Using a StringVar avoids the error when the entry is blanked, but 
currently allows non-ints to be saved.  A better solution would be to not do 
the auto tracing, but use a IntVar and only call var_changed when the user 
'leaves' the box, after checking for a count in a sane range.

--
assignee: terry.reedy
components: IDLE
messages: 301851
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: Entry tests should delete before insert.
type: behavior
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue27099] IDLE: turn built-in extensions into regular modules

2017-09-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Charles, thank you for the work.  This was pretty tough for both of us.  My 
takeaway: getting configdialog nearly covered first was essential; even better 
tests for configdialog and other modules would have helped.

--
resolution:  -> fixed
stage: test needed -> 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



[issue30780] IDLE: configdialog - add tests for ConfigDialog GUI.

2017-09-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I just pushed the extension conversion patch.  The tests we did already were 
greatly helpful, and some tests not done or inadequate hindered.  I am now 
looking to polish configdialog before 3.6.3.  If you have anything worth a new 
issue and PR, I will be ready to review.

--

___
Python tracker 

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



[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-09-10 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3481

___
Python tracker 

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



[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-09-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 3866d9bbcf808cea98b3d7f9f246b83858ce by Terry Jan Reedy 
(Cheryl Sabella) in branch 'master':
bpo-30781: IDLE: Fix help button on configdialog (#3238)
https://github.com/python/cpython/commit/3866d9bbcf808cea98b3d7f9f246b83858ce


--

___
Python tracker 

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



[issue30780] IDLE: configdialog - add tests for ConfigDialog GUI.

2017-09-10 Thread Cheryl Sabella

Changes by Cheryl Sabella :


--
keywords: +patch
pull_requests: +3480
stage: test needed -> patch review

___
Python tracker 

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



[issue27099] IDLE: turn built-in extensions into regular modules

2017-09-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Here is a high-level overview of the steps involved in the patch, and a few 
TODOs for new issues.

Move menu specifications from feature files to mainmenu.py.  Remove enable 
items from config-extensions.def sections.  Most features were enabled for both 
shell and editor. FormatParagraph appears on the Format menu which is only 
present for editor windows.  Ditto for Check Module and Run Module and the Run 
menu. Disable CodeText in Outwin.  TODO: Also grey-out the menu item.

Handle user-configurable pseudoevent -- key sequence definitions the same for 
these features as all others.  This fixes oddities that could be considered 
bugs.  Delete them from config-extensions.def sections.  Add them to the 
default keysets in config-keys.def, with adjustments for the Mac keysets.  Let 
user changes be stored in custom keysets in config-keys.cfg instead of 
diverting them to config-extensions.cfg.  Do not warn when they are missing 
from older custom keysets (when they get default values).  TODO: Augment 
config.IdleConf to add new pairs to existing custom keysets, at least when they 
are used.

I have tested that 2.7 runs with an augmented custom keyset, ignoring the new 
keys, and does not delete the new definitions when an older one is changed and 
the keyset changed.  TODO: Fix regressions in keyset handling that predate this 
patch and were not caught by existing tests.

Handle fixed pseudoevent -- key sequence pairs more like existing non-extension 
pairs.  Delete them from config-extensions.def.  For the present, put 
event_add() calls in EditorWindow.__init__.  TODO: If I am correct that these 
calls are needed just once and not for each instance, move them.  (Not an 
immediate priority.)

Remove sections that are now empty, leaving 4 with non-key options.  Add 
widgets to the General Page of ConfigDialog for customizing these options.  
Make the option values class attributes in the respective classes, initialize 
by a class method that is called upon import and when config dialog changes are 
accepted.  (This means that changes now take effect immediately rather than 
when IDLE is started.)  For the present, for back-compatibility, leave these 
sections in config-extensions.def rather than moving them to config-main.def 
(and moving user values between the corresponding .cfg files.)  Add a note in 
config-extensions.def explaining that these sections do not represent 
extensions but why there are there.  Modify IdleConf to not treat these as 
extension sections.  TODO: re-evaluate whether some of the options should 
really be kept as options.

Add a dummy extension Zzdummy to serve as an example and for use in tests.  
TODO: Modify test so that Zzdummy can be disabled by default.

Anything else that I forgot or is too trivial to mention ;-).

--
stage: patch review -> test needed

___
Python tracker 

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



[issue27240] 'UnstructuredTokenList' object has no attribute '_fold_as_ew'

2017-09-10 Thread R. David Murray

Changes by R. David Murray :


--
keywords: +patch
pull_requests: +3478
stage: needs patch -> patch review

___
Python tracker 

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



[issue30788] email.policy.SMTP.fold() issue for long filenames with spaces

2017-09-10 Thread R. David Murray

Changes by R. David Murray :


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

___
Python tracker 

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



[issue31413] Support importing anything in ._pth files.

2017-09-10 Thread Decorater

Changes by Decorater :


--
type:  -> crash

___
Python tracker 

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



[issue31413] Support importing anything in ._pth files.

2017-09-10 Thread Decorater

New submission from Decorater:

E:\TinyURL\app\Release>tinyurl
Fatal Python error: only 'import site' is supported in ._pth file

Current thread 0x161c (most recent call first):

The above Happens when I try to use the ._pth file to automatically call 
.main()

However it prints that and then Crashes on Windows. I am not sure about how it 
does on linux or not.

I would like this extended to work how I thought it would. (To support more 
than just site.py in the standard library as this would reduce rebuilds of 
embedded interpreters.

--
components: Interpreter Core, Windows
messages: 301846
nosy: Decorater, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Support importing anything in ._pth files.
versions: Python 3.6, Python 3.7

___
Python tracker 

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



[issue31345] Backport docstring improvements to the C version of OrderedDict

2017-09-10 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks Henk-Jaap for the PR. It's been merged.

--
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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-10 Thread INADA Naoki

INADA Naoki added the comment:

>  I'm unclear about whether you understand and acknowledge why the 
> doubly-linked list was chosen and what kind of workloads it supports (we 
> didn't choose it because it was either convenient or fun, we chose it because 
> it was an algorithmically correct way of supporting arbitrary deletion, 
> move-to-front, move-to-back, pop-first, and pop-last operations all of which 
> have legitimate use cases).

Arbitrary deletion: New and current implementation has same complexity, because 
current implementation relying on dict deletion.  Only difference is current 
implementation need to remove item from link list, not only dict.

move-to-front, move-to-back: Current implementation is worst case O(1) and new 
implementation is amortized O(1), like insertion.

pop-first, pop-last: Current implementation is worst case O(1).  New 
implementation is typical case (when dict is dense) O(1).  When mixed with 
arbitrary deletion operation (dict is sparse), it's become amortized O(1).

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-10 Thread Raymond Hettinger

Raymond Hettinger added the comment:

ISTM that what is being proposed is an algorithmically flawed re-implementation 
of the ordered dictionary.  I'm unclear about whether you understand and 
acknowledge why the doubly-linked list was chosen and what kind of workloads it 
supports (we didn't choose it because it was either convenient or fun, we chose 
it because it was an algorithmically correct way of supporting arbitrary 
deletion, move-to-front, move-to-back, pop-first, and pop-last operations all 
of which have legitimate use cases).

Side note: part of the goal of the collections module is to provide builtin 
datatypes alternatives which different performance characteristics.  For 
example, deque() has a list-like API but is there to support efficient appends 
and pops from both ends while giving up efficient random access (another goal 
was obtaining more predictable performance by avoiding realloc()).

On a procedural note, it isn't a good practice to go "opinion shopping" as a 
way of trying to override the recommendations of the current maintainers of the 
code.  That seems like uncomfortable political gamesmanship.  Instead of 
throwing-out all the code, it would be a better to submit implementation 
improvements that preserve the core design (for example there are faster and 
more compact ways to store and update the links -- I can help get you started 
with this if you're interested).

--
nosy: +aronacher

___
Python tracker 

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



[issue27099] IDLE: turn built-in extensions into regular modules

2017-09-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset d6c397bf772a8f17e00afc5e0a2cf37fdebcdf29 by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-27099: IDLE - Convert built-in extensions to regular features 
(GH-2494) (#3487)
https://github.com/python/cpython/commit/d6c397bf772a8f17e00afc5e0a2cf37fdebcdf29


--

___
Python tracker 

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



[issue31361] Update feedparser.py to prevent theano compiling fail in python3

2017-09-10 Thread Wei-Shun Lo

Wei-Shun Lo added the comment:

Hi David,

>From the error message, the source of the None object was from pip, and it
is grabbing data from the metadata of the package.

  File "/usr/local/lib/python3.6/site-packages/pip/utils/packaging.py",
line 48, in check_dist_requires_python
-- By adding 'print(metadata)' on line 46, I have the metadata of theano as
attached.

So another fix maybe adding str() in the packaging.py in pip, I tested it
too and worked fine. It appears to me as of now, getting pip to send the
metadata in string seems to be better.

As for the NoneType object error, somehow it no longer pops up, it might be
related to the original metadata, which may have not define 'METADATA' and
'PKG-INFO'.

You may close this pull request and issue, I believe that's not necessary
for now.

Thanks !

[image: Inline image 2]
​

*​Theano's metatdata*​
​
​ ​

Metadata-Version: 1.1

Name: Theano

Version: 0.9.0

Summary: Optimizing compiler for evaluating mathematical expressions on
CPUs and GPUs.

Home-page: http://deeplearning.net/software/theano/

Author: LISA laboratory, University of Montreal

Author-email: theano-...@googlegroups.com

License: BSD

Description-Content-Type: UNKNOWN

Description: Theano is a Python library that allows you to define,
optimize, and efficiently evaluate mathematical expressions involving
multi-dimensional arrays. It is built on top of NumPy_. Theano features:

 * **tight integration with NumPy:** a similar interface to
NumPy's. numpy.ndarrays are also used internally in Theano-compiled
functions.

 * **transparent use of a GPU:** perform data-intensive
computations up to 140x faster than on a CPU (support for float32 only).

 * **efficient symbolic differentiation:** Theano can compute
derivatives for functions of one or many inputs.

 * **speed and stability optimizations:** avoid nasty bugs when
computing expressions such as log(1 + exp(x)) for large values of x.

 * **dynamic C code generation:** evaluate expressions faster.

 * **extensive unit-testing and self-verification:** includes tools
for detecting and diagnosing bugs and/or potential problems.

Theano has been powering large-scale computationally intensive
scientific

research since 2007, but it is also approachable enough to be used
in the

classroom (IFT6266 at the University of Montreal).

.. _NumPy: http://numpy.scipy.org/

=

Release Notes

=

Theano 0.9.0 (20th of March, 2017)

==

This is a final release of Theano, version ``0.9.0``, with a lot of

new features, interface changes, improvements and bug fixes.

We recommend that everybody update to this version.

Highlights (since 0.8.0):

 - Better Python 3.5 support

 - Better numpy 1.12 support

 - Conda packages for Mac, Linux and Windows

 - Support newer Mac and Windows versions

 - More Windows integration:

   - Theano scripts (``theano-cache`` and ``theano-nose``) now
works on Windows

   - Better support for Windows end-lines into C codes

   - Support for space in paths on Windows

 - Scan improvements:

   - More scan optimizations, with faster compilation and gradient
computation

   - Support for checkpoint in scan (trade off between speed and
memory usage, useful for long sequences)

   - Fixed broadcast checking in scan

 - Graphs improvements:

   - More numerical stability by default for some graphs

   - Better handling of corner cases for theano functions and graph
optimizations

   - More graph optimizations with faster compilation and execution

   - smaller and more readable graph

 - New GPU back-end:

   - Removed warp-synchronous programming to get good results with
newer CUDA drivers

   - More pooling support on GPU when cuDNN isn't available

   - Full support of ignore_border option for pooling

   - Inplace storage for shared variables

   - float16 storage

   - Using PCI bus ID of graphic cards for a better mapping between
theano device number and nvidia-smi number

   - Fixed offset error in ``GpuIncSubtensor``

 - Less C code compilation

 - Added support for bool dtype

 - Updated and more complete documentation

 - Bug fixes related to merge optimizer and shape inference

 - Lot of other bug fixes, crashes fixes and warning improvements

A total of 123 people contributed to this release since 0.8.0, see
list below.

Interface changes:

 - Merged ``CumsumOp/CumprodOp`` into ``CumOp``

 - In MRG module:

   - Replaced method ``multinomial_wo_replacement()`` with new
method ``choice()``

   - Random generator now tries to infer the 

[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-10 Thread INADA Naoki

INADA Naoki added the comment:

> Just for the record, here is the draft of the post I was going to make on 
> python-dev but didn't prove to be necessary.

Thank you for write down your thought.

For move_to_end(), I admit new behavior is *amortized* O(1) and
current behavior is *worst-case* O(1).

When I implemented compact ordered dict in last year, my motivation
was porting PyPy's efficiency to CPython.
And this issue is based on same motivation.

So I want to hear Armin's opinion before closing this issue.

--
nosy: +arigo

___
Python tracker 

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



[issue31373] demoting floating float values to unrepresentable types is undefined behavior

2017-09-10 Thread Mark Dickinson

Mark Dickinson added the comment:

> It's hard to win here I think.

Agreed.

> It seems like the undefined behavior sanitizer is being overzealous when the 
> target supports IEEE754.

Also agreed.

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-10 Thread INADA Naoki

INADA Naoki added the comment:

The discussion on [1] was for removing pure Python implementation,
not about changing C implementation.

[1]: https://mail.python.org/pipermail/python-dev/2017-September/149147.html

While I withdrawed my suggestion about removing pure Python implementation,
I still think this new implementation is valuable.

Dict ordering is not language spec and many libraries including stdlib
uses OrderedDict to keep insertion order.
Faster creation, iteration and 1/2 memory usage is good enhancement
for most use cases.

--

___
Python tracker 

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



[issue25115] SSL_set_verify_depth not exposed by the ssl module

2017-09-10 Thread Grant Bremer

Grant Bremer added the comment:

The use case is for an internal PKI implementation where verification should 
be, needs to be limited to certificates signed by the PKI CA and no higher to, 
say, a larger realm which would not be appropriate.

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-10 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Just for the record, here is the draft of the post I was going to make on 
python-dev but didn't prove to be necessary.

-

I think would be a mistake to replace the implementation of 
collections.OrderedDict() with the builtin compact-and-ordered dict.  They 
serve different use cases and deserve different implementations that best serve 
those use cases.

When PEP 372 for the OrderedDict was accepted a decade ago, Armin and I looked 
at various implementation strategies.  It came down to a contest between 
keeping the order in an arraylike structure (like a Python list) or using a 
doubly-linked list.  The latter was chosen because it had superior algorithmic 
performance for workloads that involved a mix of insertions and deletions.  In 
particular, it offered a constant time guarantee for popping from any location 
or doing a move_to_front or move_to_last operation (which was helpful in 
implementing an LRU cache for example).  It supported arbitrary deletions and 
insertions without leaving holes that require periodic compaction.  When Eric 
Snow implemented OrderedDict in C for Python 3.5, he kept the doubly-linked 
list design to maintain those benefits.

In contrast, when I proposed the design for the current Python built-in 
dictionary, it had a different goal, namely compact storage.  It is very good 
at meeting that goal. However, the ordering of keys was a side-effect and 
somewhat of an afterthought rather than being something it was designed to 
handle well (which may be one of the reasons that Guido did not guarantee the 
ordering behavior).

At last year’s sprints, there was a deliberate decision to not replace the 
OrderedDict with the built-in dict.  I believe that decision was a good one and 
should be maintained.   It will allow us to have a separation of concerns and 
continue to improve the OrderedDict in a way that best supports applications 
that do interesting things with ordering (such as Antoine’s idea to use an 
OrderedDict as a circular queue).

I fully support efforts to improve the code for collections.OrderedDict() but 
think it is essential for it to evolve separately from the built-in dict and 
for its implementation strategy to be primarily focused efficiently maintaining 
order (its raison d'etre).

--

___
Python tracker 

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



[issue31265] Remove doubly-linked list from C OrderedDict

2017-09-10 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Based on the python-dev discussion, can we close this now?

--

___
Python tracker 

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



[issue27099] IDLE: turn built-in extensions into regular modules

2017-09-10 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
keywords: +patch
pull_requests: +3477
stage: test needed -> patch review

___
Python tracker 

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



[issue8231] Unable to run IDLE without write-access to home directory

2017-09-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I closed #30918 as a duplicate of this.  It has full 'set' and expanduser info.

--

___
Python tracker 

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



[issue30918] Unable to launch IDLE in windows 7

2017-09-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Thanks for the information.  I hope to get to this before 3.6.3.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Unable to run IDLE without write-access to home directory

___
Python tracker 

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



[issue27099] IDLE: turn built-in extensions into regular modules

2017-09-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 58fc71c447049d0efe4e11db1b55edc307f1bede by Terry Jan Reedy 
(wohlganger) in branch 'master':
bpo-27099: IDLE - Convert built-in extensions to regular features (#2494)
https://github.com/python/cpython/commit/58fc71c447049d0efe4e11db1b55edc307f1bede


--

___
Python tracker 

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



[issue30918] Unable to launch IDLE in windows 7

2017-09-10 Thread dongdong

dongdong added the comment:

Hi Terry,
Sorry,  I missed your resply because it was buried in my trash email.
Here are the configuration in my PC:
HOMEDRIVE=Z:
HOMEPATH=\
HOMESHARE=\\nt3.imec.be\zhai65
LOCALAPPDATA=C:\Users\zhai65\AppData\Local

USERPROFILE=C:\Users\zhai65

In python
>>> expanduser('~')
'C:\\Users\\zhai65'

I partly bypassed the bug by following the instructions shown in my
previous link.

*Best Regards!*
*--*

*Eric Donghui **Zhai *
* PhD Candidate*
*IMEC & KU Leuven*

*Mobile: +32-0489 676629 Email: trencyclope...@gmail.com 
 *
*Address: **IMEC, Kapeldreef 75, Leuven, Belgiium*

On 14 July 2017 at 22:05, Terry J. Reedy  wrote:

>
> Changes by Terry J. Reedy :
>
>
> --
> assignee:  -> terry.reedy
> components: +IDLE
> type: crash -> behavior
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31373] demoting floating float values to unrepresentable types is undefined behavior

2017-09-10 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I'm going to undo the changes to getargs.c and floatobject.c. I think the 
pytime.c change is still correct because the doubles are explicitly rounded 
before conversion (and the old code checked for error > 1.0).

It's hard to win here I think. The clang undefined behavior sanitizer uses 
FLT_MAX to make its determination:
runtime error: value 3.40282e+38 is outside the range of representable values 
of type 'float'

So to satisfy it and preserve the old behavior, we would presumably have to 
implement the rounding ourselves, which doesn't seem like fun.

Annex F of C99, which defines the requirements for C implementations using 
IEE754, says, "the conversions for floating types provide  the IEC 60559 
conversions between floating-point precisions.". Those are, of course, fully 
defined. It seems like the undefined behavior sanitizer is being overzealous 
when the target supports IEEE754.

--

___
Python tracker 

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



[issue31373] demoting floating float values to unrepresentable types is undefined behavior

2017-09-10 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
pull_requests: +3476

___
Python tracker 

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



[issue31411] SystemError raised by warn_explicit() in case warnings.onceregistry is not a dict

2017-09-10 Thread Serhiy Storchaka

Changes 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



[issue31411] SystemError raised by warn_explicit() in case warnings.onceregistry is not a dict

2017-09-10 Thread Oren Milman

Changes by Oren Milman :


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

___
Python tracker 

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



[issue31412] wave.open does not accept PathLike objects

2017-09-10 Thread Michael Cuthbert

Changes by Michael Cuthbert :


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

___
Python tracker 

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



[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-10 Thread Christian Heimes

Christian Heimes added the comment:

Victor is currently travelling and recovering from jetlag. I'm sure he'll reply 
within a day or two.

--
assignee:  -> haypo

___
Python tracker 

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



[issue29136] Add OP_NO_TLSv1_3

2017-09-10 Thread Christian Heimes

Christian Heimes added the comment:


New changeset 28580316a57d1757978196c27286f989d21ec0f3 by Christian Heimes in 
branch '3.6':
bpo-29136: Fix versionchange for TLS 1.3 changes (#3483)
https://github.com/python/cpython/commit/28580316a57d1757978196c27286f989d21ec0f3


--

___
Python tracker 

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



[issue29136] Add OP_NO_TLSv1_3

2017-09-10 Thread Christian Heimes

Christian Heimes added the comment:

Thanks, I fixed versionchanged.

--
stage: patch review -> resolved
status: open -> closed
versions: +Python 2.7, Python 3.7

___
Python tracker 

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



[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-10 Thread Stefan Behnel

Stefan Behnel added the comment:

No, that one was addressed. I think only Victor's comment is still open, that's 
why I asked back.

--

___
Python tracker 

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



[issue31412] wave.open does not accept PathLike objects

2017-09-10 Thread Michael Cuthbert

Changes by Michael Cuthbert :


--
components: +Library (Lib)
type:  -> enhancement

___
Python tracker 

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



[issue31412] wave.open does not accept PathLike objects

2017-09-10 Thread Michael Cuthbert

New submission from Michael Cuthbert:

The wave library (reading and writing .wav audio files) accepts filehandles, 
strings, and bytes, but does not accept PathLike objects.  Patch will modify 
wave.py to allow open to use these objects.

--
messages: 301826
nosy: mscuthbert
priority: normal
severity: normal
status: open
title: wave.open does not accept PathLike objects
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



[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

My comment was addressed.

As for using the _Py_IDENTIFIER API, I don't think it is related. The speedup 
was caused by avoiding few simple checks and function calls. The _Py_IDENTIFIER 
API is great, but it has a small overhead which is comparable to the small 
difference caused by Stefan's patch.

--

___
Python tracker 

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



[issue29136] Add OP_NO_TLSv1_3

2017-09-10 Thread Christian Heimes

Changes by Christian Heimes :


--
pull_requests: +3473
stage: needs patch -> patch review

___
Python tracker 

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



[issue31370] Remove support for threads-less builds

2017-09-10 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
pull_requests: +3472

___
Python tracker 

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



[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-10 Thread Christian Heimes

Christian Heimes added the comment:

Good work, Stefan! It's an impressive speedup of class creation.

It looks like you have not yet addressed Serhiy's comment 
https://github.com/python/cpython/pull/3279/files#r136815648

--
nosy: +christian.heimes

___
Python tracker 

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



[issue31410] int.__repr__() is slower than repr()

2017-09-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +3471

___
Python tracker 

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



[issue31336] Speed up _PyType_Lookup() for class creation

2017-09-10 Thread Stefan Behnel

Stefan Behnel added the comment:

Any more comments on the proposed implementation? 13-15% seem worth it to me.

@Victor, or are you saying "PyId, or no change at all"?

--

___
Python tracker 

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



[issue31411] SystemError raised by warn_explicit() in case warnings.onceregistry is not a dict

2017-09-10 Thread Oren Milman

New submission from Oren Milman:

The following code causes warn_explicit() (in Python/_warnings.c) to raise a
SystemError:

import warnings
warnings.filterwarnings('once')
warnings.onceregistry = None
warnings.warn_explicit(message='foo', category=Warning, filename='bar',
   lineno=1, registry=None)


this is because warn_explicit() assumes that warnings.onceregistry is a dict,
and passes it to update_registry(), which passes it to already_warned(), which
eventually passes it to _PyDict_SetItemId(), which raises the SystemError.

--
components: Extension Modules
messages: 301822
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: SystemError raised by warn_explicit() in case warnings.onceregistry is 
not a dict
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



[issue31410] int.__repr__() is slower than repr()

2017-09-10 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Following the StackOverflow question [1].

Calling repr() is faster than calling unbound method __repr__(). This looks 
strange at first glance because it is *obvious* that repr() is implemented via 
calling __repr__().

$ ./python -m timeit "''.join(map(repr, range(1)))"
500 loops, best of 5: 809 usec per loop

$ ./python -m timeit "''.join(map(int.__repr__, range(1)))"
200 loops, best of 5: 1.27 msec per loop

Actually repr() just called the tp_repr slot, while calling int.__repr__ passes 
through many intermediate layers.

Proposed PR gets rid of a half of the overhead. It avoids creating and calling 
an itermediate function object. The result still is slower then calling repr().

$ ./python -m timeit "''.join(map(int.__repr__, range(1)))"
200 loops, best of 5: 1.01 msec per loop


The PR also speeds up calling classmethod descriptors.

$ ./python -m timeit -s "cm = bytes.fromhex; args = [('',)]*1; from 
itertools import starmap" -- "b''.join(starmap(cm, args))"
500 loops, best of 5: 515 usec per loop


$ ./python -m timeit -s "cm = bytes.__dict__['fromhex']; args = [(bytes, 
'')]*1; from itertools import starmap" -- "b''.join(starmap(cm, args))"
500 loops, best of 5: 704 usec per loop

Patched:

$ ./python -m timeit -s "cm = bytes.__dict__['fromhex']; args = [(bytes, 
'')]*1; from itertools import starmap" -- "b''.join(starmap(cm, args))"
500 loops, best of 5: 598 usec per loop


[1] 
https://stackoverflow.com/questions/45376719/why-is-reprint-faster-than-strint

--
components: Interpreter Core
messages: 301821
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: int.__repr__() is slower than repr()
type: performance
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



[issue29136] Add OP_NO_TLSv1_3

2017-09-10 Thread Christian Heimes

Christian Heimes added the comment:

Good catch, thanks! I'll update the documentation.

--
stage: resolved -> needs patch
status: closed -> open
versions:  -Python 2.7, Python 3.7

___
Python tracker 

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



[issue28638] Optimize namedtuple creation

2017-09-10 Thread Raymond Hettinger

Raymond Hettinger added the comment:


New changeset 8b57d7363916869357848e666d03fa7614c47897 by Raymond Hettinger in 
branch 'master':
bpo-28638: Optimize namedtuple() creation time by minimizing use of exec() 
(#3454)
https://github.com/python/cpython/commit/8b57d7363916869357848e666d03fa7614c47897


--

___
Python tracker 

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



[issue28638] Optimize namedtuple creation

2017-09-10 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
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



[issue31409] Implement PEP 559 - built-in noop()

2017-09-10 Thread Barry A. Warsaw

Barry A. Warsaw added the comment:

Rejected by GvR!

--
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



[issue31406] crashes when comparing between a Decimal object and a bad Rational object

2017-09-10 Thread Stefan Krah

Changes by Stefan Krah :


--
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



[issue31406] crashes when comparing between a Decimal object and a bad Rational object

2017-09-10 Thread Stefan Krah

Stefan Krah added the comment:

Thanks for the report and the patch!

--
resolution:  -> fixed
versions: +Python 3.6

___
Python tracker 

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



[issue31409] Implement PEP 559 - built-in noop()

2017-09-10 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


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

___
Python tracker 

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



[issue31409] Implement PEP 559 - built-in noop()

2017-09-10 Thread Barry A. Warsaw

New submission from Barry A. Warsaw:

Placeholder issue for discussion of the design of the implementation of PEP 559.

--
assignee: barry
components: Interpreter Core
messages: 301816
nosy: barry
priority: normal
severity: normal
status: open
title: Implement PEP 559 - built-in noop()
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



[issue31406] crashes when comparing between a Decimal object and a bad Rational object

2017-09-10 Thread Stefan Krah

Stefan Krah added the comment:


New changeset f8909d0e4b652256e4da153fa6be664490f60a07 by Stefan Krah (Miss 
Islington (bot)) in branch '3.6':
[3.6] bpo-31406: Fix crash due to lack of type checking in subclassing. 
(GH-3477) (#3479)
https://github.com/python/cpython/commit/f8909d0e4b652256e4da153fa6be664490f60a07


--

___
Python tracker 

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



[issue31406] crashes when comparing between a Decimal object and a bad Rational object

2017-09-10 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3469

___
Python tracker 

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



[issue31408] Leak in typeobject.c

2017-09-10 Thread INADA Naoki

INADA Naoki added the comment:

Maybe, PyDict_ClearFreeList() is not called?

--
nosy: +inada.naoki

___
Python tracker 

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



[issue31406] crashes when comparing between a Decimal object and a bad Rational object

2017-09-10 Thread Stefan Krah

Stefan Krah added the comment:


New changeset 3cedf46cdbeefc019f4a672c1104f3d5e94712bd by Stefan Krah in branch 
'master':
bpo-31406: Fix crash due to lack of type checking in subclassing. (#3477)
https://github.com/python/cpython/commit/3cedf46cdbeefc019f4a672c1104f3d5e94712bd


--

___
Python tracker 

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



[issue31408] Leak in typeobject.c

2017-09-10 Thread Stefan Krah

New submission from Stefan Krah:

I traced this valgrind result down to  
2ebc5ce42a8a9e047e790aefbf9a94811569b2b6 :


==23495== 240 (72 direct, 168 indirect) bytes in 1 blocks are definitely lost 
in loss record 2,255 of 2,922
==23495==at 0x4C2A9A1: malloc (vg_replace_malloc.c:299)
==23495==by 0x42C6BC: PyMem_RawMalloc (obmalloc.c:420)
==23495==by 0x42C6BC: _PyObject_Alloc (obmalloc.c:975)
==23495==by 0x42C6BC: _PyObject_Malloc (obmalloc.c:985)
==23495==by 0x448B78: _PyObject_GC_Alloc (gcmodule.c:1629)
==23495==by 0x448B78: _PyObject_GC_Malloc (gcmodule.c:1651)
==23495==by 0x448B78: _PyObject_GC_New (gcmodule.c:1663)
==23495==by 0x4A85B6: new_dict (dictobject.c:584)
==23495==by 0x4A85B6: PyDict_New (dictobject.c:624)
==23495==by 0x4AC8F0: PyDict_Copy (dictobject.c:2510)
==23495==by 0x4D68A7: set_names (typeobject.c:7138)
==23495==by 0x4D68A7: type_new (typeobject.c:2756)
==23495==by 0x4CAEC4: type_call (typeobject.c:922)
==23495==by 0x47344B: _PyObject_FastCallDict (call.c:125)
==23495==by 0x5497D2: builtin___build_class__ (bltinmodule.c:165)
==23495==by 0x4725AF: _PyMethodDef_RawFastCallKeywords (call.c:653)
==23495==by 0x4725AF: _PyCFunction_FastCallKeywords (call.c:726)
==23495==by 0x4283E0: call_function (ceval.c:4701)
==23495==by 0x4283E0: _PyEval_EvalFrameDefault (ceval.c:3218)
==23495==by 0x54D3C6: PyEval_EvalFrameEx (ceval.c:549)
==23495==by 0x54D3C6: _PyEval_EvalCodeWithName (ceval.c:4049)

--
components: Interpreter Core
messages: 301812
nosy: eric.snow, skrah
priority: normal
severity: normal
stage: needs patch
status: open
title: Leak in typeobject.c
type: resource usage
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



[issue21009] Potential deadlock in concurrent futures when garbage collection occurs during Queue.get

2017-09-10 Thread Simon Jagoe

Simon Jagoe added the comment:

In the script attached to the original issue, the weakref callback that causes 
the hang is the callback defined in ThreadPoolExecutor._adjust_thread_count

Attached is a faulthandler stack captured from Python 3.6.1. The script 
submitted here uses a patched queue.get() method to force garbage collection to 
reliably trigger the issue, but this deadlock was observed in a real 
application using threadpool executors.

--
Added file: https://bugs.python.org/file47132/executor-hang-faulthandler.txt

___
Python tracker 

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



[issue31407] --without-pymalloc broken

2017-09-10 Thread Stefan Krah

New submission from Stefan Krah:

./configure --without-pymalloc produces:

Objects/obmalloc.c: In function ‘bumpserialno’:
Objects/obmalloc.c:1326:21: error: ‘struct _pymem_runtime_state’ has no member 
named ‘serialno’
 ++_PyRuntime.mem.serialno;
 ^
Objects/obmalloc.c: In function ‘_PyMem_DebugRawAlloc’:
Objects/obmalloc.c:1417:44: error: ‘struct _pymem_runtime_state’ has no member 
named ‘serialno’
 write_size_t(tail + SST, _PyRuntime.mem.serialno);
^
Objects/obmalloc.c: In function ‘_PyMem_DebugRawRealloc’:
Objects/obmalloc.c:1502:44: error: ‘struct _pymem_runtime_state’ has no member 
named ‘serialno’
 write_size_t(tail + SST, _PyRuntime.mem.serialno);
^

--
components: Build
messages: 301810
nosy: eric.snow, skrah
priority: normal
severity: normal
stage: needs patch
status: open
title: --without-pymalloc broken
type: compile error

___
Python tracker 

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



[issue31406] crashes when comparing between a Decimal object and a bad Rational object

2017-09-10 Thread Stefan Krah

Changes by Stefan Krah :


--
pull_requests: +3468

___
Python tracker 

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



[issue31406] crashes when comparing between a Decimal object and a bad Rational object

2017-09-10 Thread Oren Milman

Changes by Oren Milman :


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

___
Python tracker 

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



[issue31406] crashes when comparing between a Decimal object and a bad Rational object

2017-09-10 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +serhiy.storchaka, skrah

___
Python tracker 

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



[issue31406] crashes when comparing between a Decimal object and a bad Rational object

2017-09-10 Thread Oren Milman

New submission from Oren Milman:

The following code crashes the interpreter:

import decimal
import fractions

class BadRational(fractions.Fraction):
numerator = None
denominator = 42

decimal.Decimal() < BadRational()


this is because numerator_as_decimal() (in Modules/_decimal/_decimal.c) assumes
that 'numerator' is an integer.

multiply_by_denominator() (in Modules/_decimal/_decimal.c) also assumes that
'denominator' is an integer, and so the following code crashes the interpreter:

import decimal
import fractions

class BadRational(fractions.Fraction):
numerator = 42
denominator = None

decimal.Decimal() < BadRational()

--
components: Extension Modules
messages: 301809
nosy: Oren Milman
priority: normal
severity: normal
status: open
title: crashes when comparing between a Decimal object and a bad Rational object
type: crash
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



[issue31373] demoting floating float values to unrepresentable types is undefined behavior

2017-09-10 Thread Mark Dickinson

Mark Dickinson added the comment:

> Do you know a way to get the IEEE 754 rounding behavior without invoking C 
> undefined behavior?

One option is to hard-code the actual boundary, which is 2**128 * (1 - 2**-25) 
(as opposed to FLT_MAX, which is 2**128 * (1 - 2**-24)): values equal to or 
larger than 2**128 * (1 - 2**-25) in absolute value should raise. But that 
means assuming IEEE 754 and round-ties-to-even, which isn't an outrageous 
assumption but does make the solution feel a bit fragile.

An alternative would be to scale values in the range (FLT_MAX, 2.0 * FLT_MAX] 
by 0.5 before doing the conversion, something like this:

if (fabs(x) > FLT_MAX && !Py_IS_INFINITY(x)) {
  double half_x = 0.5 * x;
  if (half_x > FLT_MAX) {
goto Overflow;
  }
  float half_y = (float)half_x;
  if (half_y > 0.5 * FLT_MAX) {
goto Overflow;
  }
}

--

___
Python tracker 

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



[issue31311] a SystemError and a crash in PyCData_setstate() when __dict__ is bad

2017-09-10 Thread Oren Milman

Oren Milman added the comment:

just in case it was missed - I have opened two PRs for this issue.

--

___
Python tracker 

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



[issue31345] Backport docstring improvements to the C version of OrderedDict

2017-09-10 Thread Henk-Jaap Wagenaar

Henk-Jaap Wagenaar added the comment:

Hi Mariatta,

Thanks for pointing that out about 3.5. Is that also why the build failed!? I 
found it hard to parse travis' output and was surprised it failed.

Thanks for letting me know---getting it fixed. I have added my github account 
to the other one, so that should fix it for this PR?

--

___
Python tracker 

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



[issue31370] Remove support for threads-less builds

2017-09-10 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Also 'import threading' code in Tools/scripts/run_tests.py should be cleaned.

--
nosy: +Arfrever

___
Python tracker 

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



[issue28638] Optimize namedtuple creation

2017-09-10 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Microbenchmark for caching docstrings:

$ ./python -m perf timeit -s "from collections import namedtuple; names = 
['field%d' % i for i in range(1000)]" -- "namedtuple('A', names)"

With sys.intern(): Mean +- std dev: 3.57 ms +- 0.05 ms
With Python-level caching: Mean +- std dev: 3.25 ms +- 0.05 ms

--

___
Python tracker 

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



[issue29136] Add OP_NO_TLSv1_3

2017-09-10 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

In backport to 2.7 branch, ".. versionadded:: 2.7.15" and ".. versionchanged:: 
2.7.15" were used.

However, in backport to 3.6 branch, ".. versionadded:: 3.7" and ".. 
versionchanged:: 3.7" were used, instead of expected ".. versionadded:: 3.6.3" 
and ".. versionchanged:: 3.6.3".

--
nosy: +Arfrever

___
Python tracker 

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



[issue25684] ttk.OptionMenu radiobuttons aren't unique between two instances of OptionMenu

2017-09-10 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Fixed and backported to 3.6 and 2.7.
Thanks, all!

--
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



[issue25684] ttk.OptionMenu radiobuttons aren't unique between two instances of OptionMenu

2017-09-10 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:


New changeset e1847ea4a9bdc7549893091a63e14f2afbdecc32 by Mariatta (Cheryl 
Sabella) in branch '2.7':
bpo-25684: ttk.OptionMenu radiobuttons weren't unique (GH-2276) (GH-2960)
https://github.com/python/cpython/commit/e1847ea4a9bdc7549893091a63e14f2afbdecc32


--
nosy: +Mariatta

___
Python tracker 

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