[issue22570] Better stdlib support for Path objects

2016-04-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d0c8b2c1544e by Serhiy Storchaka in branch '3.5':
Issue #22570: Renamed Py_SETREF to Py_XSETREF.
https://hg.python.org/cpython/rev/d0c8b2c1544e

New changeset 719c11b6b6ff by Serhiy Storchaka in branch 'default':
Issue #22570: Renamed Py_SETREF to Py_XSETREF.
https://hg.python.org/cpython/rev/719c11b6b6ff

New changeset 7197809a7428 by Serhiy Storchaka in branch '2.7':
Issue #22570: Renamed Py_SETREF to Py_XSETREF.
https://hg.python.org/cpython/rev/7197809a7428

--

___
Python tracker 

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



[issue26200] SETREF adds unnecessary work in some cases

2016-04-05 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Please apply the new macros so that all the original DECREFs are restored 
rather than blindly converted to XDECREFs.

--

___
Python tracker 

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



[issue26200] SETREF adds unnecessary work in some cases

2016-04-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Since several core devs agree that we should have doual macros, I'll rename 
Py_SETREF to Py_XSETREF and add new Py_SETREF.

--

___
Python tracker 

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



[issue15012] test issue

2016-04-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Rietveld emails received too, but fall in spam folder as always.

--

___
Python tracker 

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



[issue23551] IDLE to provide menu link to PIP gui.

2016-04-05 Thread Eric Khoo Jiun Hooi

Eric Khoo Jiun Hooi added the comment:

Terry, how do you run the script on idle? I try to run the script with idle -r 
"script name" and it was ok.

--

___
Python tracker 

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



[issue26698] IDLE DPI Awareness

2016-04-05 Thread Westley Martínez

New submission from Westley Martínez:

IDLE is blurry on High DPI Windows, because IDLE is not DPI aware. IDLE should 
be made to be DPI aware so that the text is more readable.

--
components: IDLE, Library (Lib), Tkinter
messages: 262930
nosy: westley.martinez
priority: normal
severity: normal
status: open
title: IDLE DPI Awareness
type: enhancement
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



[issue23551] IDLE to provide menu link to PIP gui.

2016-04-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Eric: some of my comments on Upendra's file apply to yours also.

--

___
Python tracker 

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



[issue23551] IDLE to provide menu link to PIP gui.

2016-04-05 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Ensurepip: for the present, I am willing to assume that is pip imports, it is 
ready to go.

try: import pip
except ImportError: 

Testing: testing that runpip works will initially be done by running the app on 
our live systems.  For automated testing of the gui, runpip should be replaced 
with a mock that looks up a response string in a dictionary of 
argument-response pairs.  The response string should have the same format as 
pip responses, though they will usually be shorted.  For instance, the dummy 
'machine' might have only two packages.  The description might be 'Description 
of package x' as that would be enough to test that a description is displayed 
when a line is double clicked.

In the last week, I have learned more about how to write functional tests for a 
GUI.  I will try to do one soon for IDLE.

Upendra: tem_pip_v3.py runs as I believe you intended from command line.  The 
details will need a scroll bar.

When run from Idle editor on my machine, it behaves strangely.  first, it 
restarts in a new shell window instead of the existing one.  This is wrong and 
I have not seen it before.  I have not yet figured out why.

Next, a blank console window appears before the tkinter gui window and 
disappears when the tkwindow appears.  Ditto. When an entry is double-click, a 
console window is opened and closed and no details are displayed.  Changing 
["pip"] to ["pythonw", "-m", "pip"] fixes these issues.

The _get_data function is not needed for tests that I can think of.  Please 
remove debug prints and the 'are you sure you want to quit' box.

Eric: the vscroll is on a row above the Treeview.  Give explicit row and column 
for each grid call, and group together the grid calls for a given frame.

--

___
Python tracker 

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



[issue26689] Add `has_flag` method to `distutils.CCompiler`

2016-04-05 Thread Sylvain Corlay

Sylvain Corlay added the comment:

Are you fine with the new state of the patch?

--

___
Python tracker 

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



[issue26039] More flexibility in zipfile write interface

2016-04-05 Thread Thomas Kluyver

Thomas Kluyver added the comment:

Sorry for the delay, this fell off my radar because emails from both the bug 
tracker and Rietveld tend to fall foul of my spam filters, so I have to go and 
check.

I have implemented Serhiy's suggestions, but there turns out to be a test 
(test_write_after_read) that calls writestr while a reading handle is open, and 
it now fails. This is absolutely expected according to the design we discussed, 
but if there's a test, I guess that means we need to keep that functionality 
working?

In principle, the only thing that's not possible is interleaving writes to 
multiple files within the zip - because we don't know where to start writing 
the second file. We should be able to have one writer and n readers going at 
once, but every time I start looking into that I get mired in complexity. Maybe 
(hopefully) there's some critical abstraction that hasn't occurred to me.

--
Added file: http://bugs.python.org/file42375/zipfile-open-w5.patch

___
Python tracker 

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



[issue10796] Improve doc for readline.set_completer_delims()

2016-04-05 Thread Martin Panter

Martin Panter added the comment:

My update includes a new section called Completion, with the following text:

By default, Readline is set up to be used by “rlcompleter” to complete Python 
identifiers for the interactive interpreter. If the “readline” module is to be 
used with a custom completer, a different set of word delimiters should be set.

I hope that is enough to call this fixed :)

--
resolution:  -> fixed
stage: needs patch -> resolved
status: open -> closed
versions: +Python 3.5, Python 3.6 -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue6953] readline documentation needs work

2016-04-05 Thread Martin Panter

Martin Panter added the comment:

Thanks for the reviews.

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



[issue26697] tkFileDialog crash on askopenfilename Python 2.7 64-bit Win7

2016-04-05 Thread Zachary Ware

Changes by Zachary Ware :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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



[issue26697] tkFileDialog crash on askopenfilename Python 2.7 64-bit Win7

2016-04-05 Thread Eric Johnson

New submission from Eric Johnson:

Attempting to run tkFileDialog.askopenfilename() using Python 64-bit on Windows 
7 crashes.

Running SysWOW64\cmd.exe:

Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation.  All rights reserved.

C:\Windows\SysWOW64>python
Python 2.7.11rc1 (v2.7.11rc1:82dd9545bd93, Nov 21 2015, 23:25:27) [MSC v.1500 64
 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter
>>> Tkinter.Tcl().eval('info patchlevel')
'8.5.15'
>>> import tkFileDialog
>>> filename = tkFileDialog.askopenfilename()

C:\Windows\SysWOW64>


The application abruptly stops.

Running the same application with Python 32-bit does not crash.

--
components: Tkinter
files: fileopendialog.py
messages: 262923
nosy: Eric Johnson
priority: normal
severity: normal
status: open
title: tkFileDialog crash on askopenfilename Python 2.7 64-bit Win7
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file42374/fileopendialog.py

___
Python tracker 

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



[issue25731] Assigning and deleting __new__ attr on the class does not allow to create instances of this class

2016-04-05 Thread jcristau

jcristau added the comment:

This change in 2.7 seems to break things:

$ cat foo.pxd 
cdef class B:
cdef object b
$ cat foo.pyx 
cdef class A:
pass

cdef class B:
def __init__(self, b):
self.b = b
$ cat bar.py
from foo import A, B

class C(A, B):
def __init__(self):
B.__init__(self, 1)

C()
$ cython foo.pyx && gcc -I/usr/include/python2.7 -Wall -shared -fPIC -o foo.so 
foo.c
$ python -c 'import bar'
Segmentation fault

C's tp_new is set to A's tp_new function, thus the b slot is never initialized 
to Py_None, and C's __init__ calls DECREF on a NULL pointer.

Reverting changeset e7062dd9085e makes things work again, with C's tp_new being 
B's tp_new.

--
nosy: +jcristau

___
Python tracker 

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



[issue15012] test issue

2016-04-05 Thread R. David Murray

R. David Murray added the comment:

Oh, good, thank you for the confirmation.  It is not a complete cure, but at 
least it helps.  (I won't be surprised if rietveld emails still get blocked, 
for example.)

--

___
Python tracker 

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



[issue15012] test issue

2016-04-05 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Hurray! This works!

--

___
Python tracker 

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



[issue15012] test issue

2016-04-05 Thread R. David Murray

R. David Murray added the comment:

Test nosy email with ipv4 only in postfix.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue26696] Document collections.abc.ByteString

2016-04-05 Thread Brett Cannon

New submission from Brett Cannon:

[typing.ByteString](https://docs.python.org/3.5/library/typing.html#typing.ByteString)
 references collections.abc.ByteString, but no such type is documented.

--
components: Library (Lib)
messages: 262918
nosy: brett.cannon, gvanrossum
priority: normal
severity: normal
stage: needs patch
status: open
title: Document collections.abc.ByteString
versions: Python 3.5, Python 3.6

___
Python tracker 

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



[issue26696] Document collections.abc.ByteString

2016-04-05 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> docs@python
components: +Documentation -Library (Lib)
nosy: +docs@python

___
Python tracker 

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



[issue26664] find a bug in activate.fish of venv of cpython3.6

2016-04-05 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +brett.cannon

___
Python tracker 

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



[issue26664] find a bug in activate.fish of venv of cpython3.6

2016-04-05 Thread Vinay Sajip

Vinay Sajip added the comment:

I've asked the person who sent in the patch for #26348 to comment on this issue.

--

___
Python tracker 

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



[issue26677] pyvenv: activate.fish breaks $PATH for bash scripts

2016-04-05 Thread Goneri Le Bouder

Goneri Le Bouder added the comment:

A work around is to unset the _OLD_VIRTUAL_PATH variable before the activate:

set -e _OLD_VIRTUAL_PATH

--
nosy: +Goneri Le Bouder

___
Python tracker 

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



[issue26667] Update importlib to accept pathlib.Path objects

2016-04-05 Thread Ethan Furman

Changes by Ethan Furman :


--
nosy: +ethan.furman

___
Python tracker 

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



[issue26691] Update the typing module to match what's in github.com/python/typing

2016-04-05 Thread Guido van Rossum

Guido van Rossum added the comment:

(And back. Guido.van.Rossum no longer has developer privileges.)

--
assignee: Guido.van.Rossum -> gvanrossum

___
Python tracker 

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



[issue26691] Update the typing module to match what's in github.com/python/typing

2016-04-05 Thread Guido van Rossum

Guido van Rossum added the comment:

(Testing assignment to my alter ego. :-)

--
assignee: gvanrossum -> Guido.van.Rossum
nosy: +Guido.van.Rossum

___
Python tracker 

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



[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()

2016-04-05 Thread skydoom

skydoom added the comment:

I quote the "issue 1947" just because I did a search in the db before I file 
this issue and find its output is similar to what I see, (except that it has 
"AttributeError" which mine does not have.) and because it's filed for 2.5 and 
I am not sure if this is just some minor "wording changes".

I tend to believe my issue is not the same issue with 1947 now.

--

___
Python tracker 

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



[issue26234] The typing module includes 're' and 'io' in __all__

2016-04-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset be3c4151d9bf by Guido van Rossum in branch '3.5':
Many changes from the upstream repo (https://github.com/python/typing).
https://hg.python.org/cpython/rev/be3c4151d9bf

--
nosy: +python-dev

___
Python tracker 

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



[issue26691] Update the typing module to match what's in github.com/python/typing

2016-04-05 Thread Guido van Rossum

Guido van Rossum added the comment:

Done!

changeset:   100854:78b84ae0b745
tag: tip
parent:  100852:856d50130154
parent:  100853:be3c4151d9bf
user:Guido van Rossum 
date:Tue Apr 05 08:35:22 2016 -0700
summary: Merge upstream typing.py changes from 3.5 branch.

changeset:   100853:be3c4151d9bf
branch:  3.5
parent:  100851:b1acd6cf15b6
user:Guido van Rossum 
date:Tue Apr 05 08:28:52 2016 -0700
summary: Many changes from the upstream repo 
(https://github.com/python/typing).

--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26391] typing: Specialized sub-classes of Generic never call __init__

2016-04-05 Thread Guido van Rossum

Changes by Guido van Rossum :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26234] The typing module includes 're' and 'io' in __all__

2016-04-05 Thread Guido van Rossum

Changes by Guido van Rossum :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue26391] typing: Specialized sub-classes of Generic never call __init__

2016-04-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset be3c4151d9bf by Guido van Rossum in branch '3.5':
Many changes from the upstream repo (https://github.com/python/typing).
https://hg.python.org/cpython/rev/be3c4151d9bf

--
nosy: +python-dev

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-05 Thread Robert Smallshire

Robert Smallshire added the comment:

Thanks Stefan for the illuminating example.

I knew I shouldn't have strayed off-topic.

--

___
Python tracker 

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



[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()

2016-04-05 Thread Zachary Ware

Zachary Ware added the comment:

So there is actually no relation to #1947.

--
resolution: duplicate -> 
superseder: Exception exceptions.AttributeError '_shutdown' in  

___
Python tracker 

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



[issue26695] pickle and _pickle accelerator have different behavior when unpickling an object with falsy __getstate__ return

2016-04-05 Thread Josh Rosenberg

New submission from Josh Rosenberg:

According to a note on the pickle docs ( 
https://docs.python.org/3/library/pickle.html#object.__getstate__ ): "If 
__getstate__() returns a false value, the __setstate__() method will not be 
called upon unpickling."

The phrasing is a little odd (since according to the __setstate__ docs, there 
is a behavior for classes without __setstate__ where it just assigns the 
contents of the pickled state dict to the __dict__ of the object), but to me, 
this means that any falsy value should prevent any __setstate__-like behavior.

But this is not how it works. Both the C accelerator and Python code treat None 
specially (they don't pickle state at all if it's None), which prevents 
__setstate__ or the __setstate__-like fallback from being executed.

But if it's any other falsy value, the behaviors differ, and diverge from the 
docs. Specifically, on load of a pickle with a non-None falsy state (say, False 
itself, or 0, or () or []):

Without __setstate__:
Pure Python pickle: Does not execute fallback code, behaves as expected (it 
just stored state it will never use), matching spirit of docs
C accelerated _pickle: Fails on anything but the empty dict with an 
UnpicklingError: state is not a dictionary, violating spirit of docs

With __setstate__:
Both versions call __setstate__ even though the documentation explicitly says 
they will not.

Seems like if nothing else, the docs should agree with the code, and the C and 
Python modules should agree on behavior.

I would not be at all surprised if outside code depends on being able to pickle 
falsy state and have its __setstate__ receive the falsy state (if nothing else, 
when the state is a container or number, being empty or 0 would be reasonable; 
failing to call __setstate__ in that case would be surprising). So it's 
probably not a good idea to make the implementation match the docs.

My proposal would be that at pickle time, if the class lacks __setstate__, 
treat any falsy return value as None. This means:

1. pickles are smaller (no storing junk that the default __setstate__-like 
behavior can't use)
2. pickles are valid (no UnpicklingError from the default __setstate__-like 
behavior)

The docs would also have to change, to indicate that, if defined, __setstate__ 
will be called even if __getstate__ returned a falsy (but not None) value.

Downside is the description of what happens is a little complex, since the 
behavior for non-None falsy values differs depending on the presence of a real 
__setstate__. Upside is that any code depending on the current behavior of 
falsy state being passed to __setstate__ keeps working, CPython and other 
interpreters will match behavior, and classes without __setstate__ will have 
smaller pickles.

--
assignee: docs@python
components: Documentation
messages: 262908
nosy: docs@python, josh.r
priority: normal
severity: normal
status: open
title: pickle and _pickle accelerator have different behavior when unpickling 
an object with falsy __getstate__ return
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-05 Thread Stefan Krah

Stefan Krah added the comment:

On Tue, Apr 05, 2016 at 02:20:19PM +, Robert Smallshire wrote:
> >> Were float to inherit from Rational, rather than Real ...
> 
> > This would break the Liskov substitution principle.
> 
> How so?  Rational extends Real with only numerator, denominator and 
> __float__. Isn't the existence of float.as_integer_ratio demonstration that 
> numerator and denominator could be implemented?

Substitution principle:

Let phi(x) be a property provable about objects x of type T. Then phi(y) should
be true for objects y of type S where S is a subtype of T.

Use:

  Let phi(n) = forall n: n elt nat => (1 / n) * n == 1

Counterexample:

   n == 9992

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-05 Thread Robert Smallshire

Robert Smallshire added the comment:

>> Were float to inherit from Rational, rather than Real ...

> This would break the Liskov substitution principle.

How so?  Rational extends Real with only numerator, denominator and __float__. 
Isn't the existence of float.as_integer_ratio demonstration that numerator and 
denominator could be implemented?

--

___
Python tracker 

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



[issue26693] Exception ignored in: in _shutdown, assert tlock.locked()

2016-04-05 Thread skydoom

skydoom added the comment:

I just update the title to be precise.
Exception ignored in:  in _shutdown, 
assert tlock.locked()
AssertionError:

--
title: Exception exceptions.AttributeError '_shutdown' in  
-> Exception ignored in:  in 
_shutdown, assert tlock.locked()

___
Python tracker 

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



[issue26693] Exception exceptions.AttributeError '_shutdown' in

2016-04-05 Thread skydoom

skydoom added the comment:

sorry Martin, you are right, my original title was simply (and wrongly) copied 
over from the issue 1947. You get my identical error message in your post.

--

___
Python tracker 

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



[issue26693] Exception exceptions.AttributeError '_shutdown' in

2016-04-05 Thread skydoom

skydoom added the comment:

I print out the threading.__file__ and can see it's 
"${PYTHONHOME}/lib/python3.5/threading.py" . I don't have any other 
"threading.py" elsewhere. so what should I do?

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-05 Thread Stefan Krah

Stefan Krah added the comment:

On Tue, Apr 05, 2016 at 01:10:25PM +, Robert Smallshire wrote:
> Were float to inherit from Rational, rather than Real ...

This would break the Liskov substitution principle.

--

___
Python tracker 

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



[issue26680] Incorporating float.is_integer into the numeric tower and Decimal

2016-04-05 Thread Robert Smallshire

Robert Smallshire added the comment:

Java makes no claim to have a numeric tower.  Amongst the dynamic languages I 
surveyed Matlab (isinteger), Javascript ES6 (isInteger), PHP (is_integer), R 
(is.integer), TCL (is entier), and as we have seen Scheme (integer?) all have 
methods for testing for integer values. Python has a numeric tower modelled on 
Scheme. In the Scheme documentation we find this:

"...the integer 5 may have several representations. Scheme's numerical 
operations treat number objects as abstract data, as independent of their 
representation as possible. Although an implementation of Scheme may use many 
different representations for numbers, this should not be apparent to a casual 
programmer writing simple programs."

This is what I'm advocating.

There isn't a single mathematical (as opposed to representational) method on 
int that isn't 'inherited' from the numeric tower.  There are exactly two 
methods on float which aren't inherited from the tower: is_integer and 
as_integer_ratio.  So I think it's would be a stretch to claim that "Most of 
the [numerical] ABCs have only a subset of the [numerical] methods in the 
[numerical] concrete types."

Rather than looking at the numeric tower as a construct which forces 
proliferation of methods, it would be better to look on it as a device to 
prevent bloat. I risk straying off topic here, but I want to give an example of 
why the numeric tower is important:

Were float to inherit from Rational, rather than Real (all finite floats are 
rationals with a power-of-two denominator, all Decimals are rationals with a 
power-of-ten denominator, so this is reasonable) then the as_integer_ratio 
method which was added to float and latterly Decimal 
(http://bugs.python.org/issue25928), arguably cluttering their interfaces, may 
have been deemed unnecessary. The numerator and denominator attributes present 
in Rational could have been used instead.  I think this is an example of lack 
of adherence to the numeric tower (at least in spirit in the case of Decimal) 
resulting in interface clutter or bloat.

The consequent control-flow complexity required handle numeric objects as 
'abstract data' is surprising: statistics._exact_ratio is a good example of 
this. I count five API tests just to be able to treat numbers as, well, just 
numbers.

--

___
Python tracker 

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



[issue26628] Undefined behavior calling C functions with ctypes.Union arguments

2016-04-05 Thread Thomas

Thomas added the comment:

Thanks Eryk for the additional explanation. I added a more elaborate example 
that doesn't abuse the standard c function that actually doesn't expect a union:

 % gcc -shared -fPIC libfoo.c -o libfoo.so -Wall
 % python pyfoo.py 
*** stack smashing detected ***: python terminated
[1]28463 segmentation fault (core dumped)  python pyfoo.py

The underling issue is exactly the same as previously described.

I still argue that ctypes should refuse to attempt such a call, and the 
documentation should be clarified, as long as libffi does not support unions.

--
Added file: http://bugs.python.org/file42373/pyfoo.py

___
Python tracker 

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



[issue26628] Undefined behavior calling C functions with ctypes.Union arguments

2016-04-05 Thread Thomas

Changes by Thomas :


Added file: http://bugs.python.org/file42372/libfoo.c

___
Python tracker 

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



[issue6953] readline documentation needs work

2016-04-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6137c46cb8df by Martin Panter in branch '2.7':
Issue #6953: Rearrange and expand Readline module documentation
https://hg.python.org/cpython/rev/6137c46cb8df

New changeset b1acd6cf15b6 by Martin Panter in branch '3.5':
Issue #6953: Rearrange and expand Readline module documentation
https://hg.python.org/cpython/rev/b1acd6cf15b6

New changeset 856d50130154 by Martin Panter in branch 'default':
Issue #6953: Merge readline doc from 3.5
https://hg.python.org/cpython/rev/856d50130154

--
nosy: +python-dev

___
Python tracker 

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



[issue10796] Improve doc for readline.set_completer_delims()

2016-04-05 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 6137c46cb8df by Martin Panter in branch '2.7':
Issue #6953: Rearrange and expand Readline module documentation
https://hg.python.org/cpython/rev/6137c46cb8df

New changeset b1acd6cf15b6 by Martin Panter in branch '3.5':
Issue #6953: Rearrange and expand Readline module documentation
https://hg.python.org/cpython/rev/b1acd6cf15b6

--
nosy: +python-dev

___
Python tracker 

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



[issue26694] Disasembler fall with Key Error while disassemble obfuscated code.

2016-04-05 Thread Steven D'Aprano

Changes by Steven D'Aprano :


--
nosy: +steven.daprano

___
Python tracker 

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



[issue25928] Add Decimal.as_integer_ratio()

2016-04-05 Thread Stefan Krah

Stefan Krah added the comment:

Raymond, you added your support in msg257097.  I'm not very happy to spend my 
time implementing the feature and then rehashing everything after 3 months.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue26694] Disasembler fall with Key Error while disassemble obfuscated code.

2016-04-05 Thread SilentGhost

Changes by SilentGhost :


--
nosy: +ncoghlan, yselivanov

___
Python tracker 

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



[issue26694] Disasembler fall with Key Error while disassemble obfuscated code.

2016-04-05 Thread Szymon Kuliński

New submission from Szymon Kuliński:

Many obfuscators use simple technice for block disasemblation. Add broken 
instructions (for example unknown op codes) and use flow control (SETUP_EXCEPT 
or JUMP_FORWARD) to skip broken instructions. Interpreter work in right way 
skipping broken instruction or catch error and go to except instructions but 
disasembler iterate over all instructions and every where assume that code is 
correct and doing something like :

elif op in hasname:
print '(' + co.co_names[oparg] + ')',


Which fails because variable oparg not in co_names table or refer to not 
existing name or const. Why dis lib not assume that code can be broken and try 
disassemble it as good as it can any way. 

   15 JUMP_IF_TRUE 3 (to 19)
   18   ()
   19 LOAD_NAME1 (b)

Or if we rely on the assumption that if code disasseblation done with no 
problem this mean that code is good. We can add flag where we can disassemble 
unsteady code or even add other method like dis_unsafe or something like that. 

Include: obfuscated and unobfuscated pyc files for testing. 

Change proposition:

Cherry-pick code dis module from 3.5 python with some changes required to 
normal working. Working example included.

--
components: Library (Lib)
files: example.zip
messages: 262895
nosy: Szymon.Kuliński
priority: normal
severity: normal
status: open
title: Disasembler fall with Key Error while disassemble obfuscated code.
type: behavior
versions: Python 2.7
Added file: http://bugs.python.org/file42371/example.zip

___
Python tracker 

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



[issue26682] Ttk Notebook tabs do not show with 1-2 char names

2016-04-05 Thread Morb

Morb added the comment:

Hello, I'm the one who posted on stackoverflow.

I'm on Windows 7 Entreprise 64 bits (6.1, version 7601).
Here is my first line when I run python:
"Python 2.7.9 (default, Dec 10 2014, 12:28:03) [MSC v.1500 64 bit (AMD64)] on 
win32".

I think it's linked to the font and its size.
I tested some combinations:
  1 alphanumeric character, bugs (can only see 3 tabs on the 5)
  2 AN chars, bugs (last tabs almost hidden)
  3 AN chars, works
  1 space and 2 AN chars, bugs
  2 spaces and 2 AN chars, works
  2 spaces and 1 AN char, bugs (the last tab is almost hidden)
  3 spaces and 1 AN char, bugs
  4 spaces and 1 AN char, works
I tried the same with a different font (Courier, 12):
  1 alphanumeric character, bugs (the last tab is hidden)
  2 AN chars, works
  3 AN chars, works
  1 space and 2 AN chars, works
  2 spaces and 2 AN chars, works
  2 spaces and 1 AN char, works
  3 spaces and 1 AN char, works
  4 spaces and 1 AN char, works

The code I added for the font:
cfont = tkFont.Font(family="Courier", size=12)
s = ttk.Style()
s.configure('.', font=cfont)

--
nosy: +Morb

___
Python tracker 

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



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

2016-04-05 Thread Martin Panter

Martin Panter added the comment:

Posting argparse_option.v2.patch, which is minimally complete version of Ryan’s 
patch. I have dropped all the nonessential code and documentation tweaks. I 
also added a What’s New entry. I’d like to know if people think this is the 
right direction to move in.

--
versions:  -Python 2.7, Python 3.5
Added file: http://bugs.python.org/file42370/argparse_option.v2.patch

___
Python tracker 

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