[issue21933] Allow the user to change font sizes with the text pane of turtledemo

2014-07-22 Thread Lita Cho

Lita Cho added the comment:

I completely agree about the mousewheel. However, would it make sense for
OS X to combine command with mousewheel? I have never seen that before. I
am not sure if I can bind the zoom gesture with tkinter, but I can find
out.

I also think the shortcuts are not intuitive as an OS X user, as command
should be used instead of Ctrl.

What I can do check the operating system and define the font shortcuts
accordingly. I am not sure about redefining the Menu shortcuts as that
seems like a separate issue.

On Mon, Jul 21, 2014 at 11:52 PM, Ned Deily  wrote:

>
> Ned Deily added the comment:
>
> Lita, I tried the patch.  From the perspective of an OS X user, while I
> might expect that using the zoom gesture on a mousepad or using a
> mousewheel (the equivalent) to increase or decrease the font size, I would
> even more expect scrolling to work especially if scrollbars are present.
>  Clearly, scrolling is more important so, if it is not possible to bind Tk
> mousewheel events without affecting scrolling, I would abandon the
> mousewheel.  On OS X, the standard way to provide size adjustment (of fonts
> or images) is to provide "Bigger" or "Smaller" menu items with the standard
> keyboard shortcuts of Command-Shift-Equal (and Command-Equal) which is
> displayed as "Command +" (so the user on a US keyboard just presses the
> Command key and the =/+ key) and Command-Hyphen ("Command -").  The Apple
> OS X Human Interface Guidelines go into more detail and you can see these
> shortcuts in action in many standard OS X applications (TextEdit, Mail,
> Safari, etc).  As it stands today, turtledemo does not use the standard OS
> X menu bar where these commands would normally be placed.  And that's a bit
> of a separate problem because since turtledemo doesn't change the root menu
> it defaults to a Tk-provided one which includes things "Run Widget Demo"
> under the file menu.  To be a proper OS X app, turtledemo should customize
> the menu, at least removing the widget demo item and then it could add the
> Bigger and Smaller menu items to a Format menu.  Actually, the turtledemo
> Examples and Help pulldown options would ideally also be available in the
> standard menu hierarchy.  I'm not suggesting that is a requirement but
> that's what I think an OS X user would expect and what the Apple HIG would
> require.
>
>
> https://developer.apple.com/library/mac/documentation/userexperience/conceptual/applehiguidelines/KeyboardShortcuts/KeyboardShortcuts.html
>
> https://developer.apple.com/library/mac/documentation/userexperience/conceptual/applehiguidelines/Menus/Menus.html
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue22028] Python 3.4.1 Installer ended prematurely (Windows msi)

2014-07-22 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +steve.dower, zach.ware

___
Python tracker 

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



[issue22003] BytesIO copy-on-write

2014-07-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

See also issue15381.

--

___
Python tracker 

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



[issue21933] Allow the user to change font sizes with the text pane of turtledemo

2014-07-22 Thread Ned Deily

Ned Deily added the comment:

On OS X, the actions associated with trackpad gestures are controlled by the 
Trackpad panel of System Preferences.  The default settings map the "pinch with 
two fingers" gesture to "Zoom in or out" which Tk apps see as Mousewheel 
events: no programming needed!

--

___
Python tracker 

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



[issue21970] Broken code for handling file://host in urllib.request.FileHandler.file_open

2014-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4b98961748f1 by Senthil Kumaran in branch '3.4':
Fix localhost checking in FileHandler. Raised in #21970.
http://hg.python.org/cpython/rev/4b98961748f1

New changeset 2c660948bb41 by Senthil Kumaran in branch 'default':
Merge 3.4
http://hg.python.org/cpython/rev/2c660948bb41

--
nosy: +python-dev

___
Python tracker 

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



[issue21970] Broken code for handling file://host in urllib.request.FileHandler.file_open

2014-07-22 Thread Senthil Kumaran

Senthil Kumaran added the comment:

I have addressed the mistake where req.host is self.get_names() was done 
instead of req.host in self.get_names() in the first commit as it was an 
obvious problem.

I will come up with patch/solution addressing the other behavior mentioned in 
this report.

--

___
Python tracker 

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



[issue21933] Allow the user to change font sizes with the text pane of turtledemo

2014-07-22 Thread Lita Cho

Lita Cho added the comment:

What really? That is so awesome! I will check that out!

However, I figure I still need to create separate bindings for Linux,
Windows and Mac, right? Or does Tkinter unify all the mousewheel events?

Lita

On Tue, Jul 22, 2014 at 12:18 AM, Ned Deily  wrote:

>
> Ned Deily added the comment:
>
> On OS X, the actions associated with trackpad gestures are controlled by
> the Trackpad panel of System Preferences.  The default settings map the
> "pinch with two fingers" gesture to "Zoom in or out" which Tk apps see as
> Mousewheel events: no programming needed!
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue22030] Use calloc in set resizing

2014-07-22 Thread Raymond Hettinger

New submission from Raymond Hettinger:

Victor, how does this look?

--
assignee: haypo
files: set_calloc.diff
keywords: patch
messages: 223638
nosy: haypo, rhettinger
priority: normal
severity: normal
stage: patch review
status: open
title: Use calloc in set resizing
type: performance
versions: Python 3.5
Added file: http://bugs.python.org/file36024/set_calloc.diff

___
Python tracker 

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



[issue21933] Allow the user to change font sizes with the text pane of turtledemo

2014-07-22 Thread Ned Deily

Ned Deily added the comment:

"However, I figure I still need to create separate bindings for Linux,
"Windows and Mac, right? Or does Tkinter unify all the mousewheel events?

I'm not sure I understand: I think that Tk only provides one MouseWheel event 
binding.  Keyboard or menu items might differ, yes, e.g. Cmd-+ vs Ctrl-+.

http://www.tcl.tk/man/tcl8.5/TkCmd/bind.htm#M9

--

___
Python tracker 

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



[issue22030] Use calloc in set resizing

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

Be careful. In my tests, calloc() was slower than malloc() + memset() for
memory blocks smaller than 1 MB. Calloc() can be interesting if only a few
pages (4096 bytes) are modified.

You must provide benchmarks.

--

___
Python tracker 

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



[issue22030] Use calloc in set resizing

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #21644 (bytearray).

--

___
Python tracker 

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



[issue21644] Optimize bytearray(int) constructor to use calloc()

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

See also issue #22030 (set).

--

___
Python tracker 

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



[issue15759] "make suspicious" doesn't display instructions in case of failure

2014-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 10b83036c723 by Serhiy Storchaka in branch '3.4':
Issue #15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/
http://hg.python.org/cpython/rev/10b83036c723

New changeset c755a3b58fa6 by Serhiy Storchaka in branch 'default':
Issue #15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/
http://hg.python.org/cpython/rev/c755a3b58fa6

New changeset a61c3d17fe4f by Serhiy Storchaka in branch '2.7':
Issue #15759: "make suspicious", "make linkcheck" and "make doctest" in Doc/
http://hg.python.org/cpython/rev/a61c3d17fe4f

--
nosy: +python-dev

___
Python tracker 

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



[issue21044] tarfile does not handle file .name being an int

2014-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 51699f5f5430 by Serhiy Storchaka in branch '2.7':
Backout 308f3c1e36d3.  This change (issue21044) does not need to be merged on
http://hg.python.org/cpython/rev/51699f5f5430

--

___
Python tracker 

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



[issue22030] Use calloc in set resizing

2014-07-22 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue21044] tarfile does not handle file .name being an int

2014-07-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Zachary for pointing to buildbot failure.

> Also, Serhiy, I think you may have got me mixed up with someone else.

Indeed, I either missed you with Antoine Pietri or missed this issue with 
issue19524. In any case thanks you for your activity on the tracker. And thanks 
Antoine Pietri for his contribution on this issue.

> Still, it would be interesting to investigate why this breaks 2.7 though.

Left open until will investigated this. Will open a new issue if there is a bug 
here.

--
resolution:  -> remind

___
Python tracker 

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



[issue15759] "make suspicious" doesn't display instructions in case of failure

2014-07-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee: docs@python -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue21933] Allow the user to change font sizes with the text pane of turtledemo

2014-07-22 Thread Lita Cho

Lita Cho added the comment:

Oh I see. And then pinch on the trackpad just generates a overall MouseWheel 
event, not a specific zoom-in event. For some reason, I thought there was a 
different event depending on operating systems. Before, Linux would trigger 
 and  events and not MouseWheel.

On Jul 22, 2014, at 12:35 AM, Ned Deily  wrote:

> 
> Ned Deily added the comment:
> 
> "However, I figure I still need to create separate bindings for Linux,
> "Windows and Mac, right? Or does Tkinter unify all the mousewheel events?
> 
> I'm not sure I understand: I think that Tk only provides one MouseWheel event 
> binding.  Keyboard or menu items might differ, yes, e.g. Cmd-+ vs Ctrl-+.
> 
> http://www.tcl.tk/man/tcl8.5/TkCmd/bind.htm#M9
> 
> --
> 
> ___
> Python tracker 
> 
> ___

--

___
Python tracker 

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



[issue22031] Hexadecimal id in reprs

2014-07-22 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Default repr of an instance looks as:

>>> object()


Many specialized reprs follow a pattern <... at {hexadecimal id}...>. But there 
are few deviations:

1. Reprs of WeakValueDictionary and WeakKeyDictionary in the weakref module 
output decimal id.

2. reprlib and reprs of CDLL in the ctypes module and DateTime and MultiCall in 
the xmlrpc.client module output hexadecimal id but without the "0x" prefix.

Proposed patch makes these cases to conform with other reprs.

--
components: Library (Lib)
files: repr_hex_id.diff
keywords: patch
messages: 223647
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Hexadecimal id in reprs
type: behavior
versions: Python 3.5
Added file: http://bugs.python.org/file36025/repr_hex_id.diff

___
Python tracker 

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



[issue22031] Hexadecimal id in reprs

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

The patch looks good to me.

--
nosy: +haypo

___
Python tracker 

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



[issue22032] Use __qualname__ together with __module__

2014-07-22 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Often when class name is reported in stdlib (e.g. in reprs), it used together 
with module name: '%s.%s' % (self.__class__.__module__, 
self.__class__.__name__). But this code is wrong when a class is nested. The 
__qualname__ attribute should be used instead of just __name__ (and it is 
already used in multiple places).

Proposed patch replaces __name__ to __qualname__ when it used together with 
module name to format full class name.

--
components: Library (Lib)
files: repr_qualname.diff
keywords: patch
messages: 223649
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Use __qualname__ together with __module__
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36026/repr_qualname.diff

___
Python tracker 

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



[issue22033] Subclass friendly reprs

2014-07-22 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

Some reprs in stdlib are subclass friendly. They contains class name or even 
fully qualified class name and substitute appropriate subclass name in 
subclasses. But some reprs contains hardcoded either class name, or module 
name, or fully qualified class name. Proposed patch makes multiple reprs in 
stdlib more subclass friendly.

See also issue22032.

--
components: Library (Lib)
files: repr_subclass_friendly.diff
keywords: patch
messages: 223650
nosy: rhettinger, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Subclass friendly reprs
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file36027/repr_subclass_friendly.diff

___
Python tracker 

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



[issue22032] Use __qualname__ together with __module__

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

The patch looks good to me.

For Python 3.4, may it break the backward compatibility? For example, breaking 
doctests relying on the exact representation? If there is a risk, it's maybe 
safer to only modify Python 3.5.

--
nosy: +haypo

___
Python tracker 

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



[issue22031] Hexadecimal id in reprs

2014-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4cef7b0ec659 by Serhiy Storchaka in branch 'default':
Issue #22031: Reprs now always use hexadecimal format with the "0x" prefix
http://hg.python.org/cpython/rev/4cef7b0ec659

--
nosy: +python-dev

___
Python tracker 

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



[issue22031] Hexadecimal id in reprs

2014-07-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Victor. Applied only in default because this issue is too minor.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue22034] posixpath.join() and bytearray

2014-07-22 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

posixpath.join() raises misleading exception in case when all arguments are 
bytearrays:

>>> import posixpath
>>> posixpath.join(bytearray(b'foo'), bytearray(b'bar'))
Traceback (most recent call last):
  File "", line 1, in 
  File "/home/serhiy/py/cpython/Lib/posixpath.py", line 91, in join
"components.") from None
TypeError: Can't mix strings and bytes in path components.

This bug was introduced in issue15377 and misleading test which provoked it was 
added in issue15180.

I proposed two patches. Patch for 3.4 only eliminates wrong specialcasing of 
bytearray (none of os.path methods work with bytearray). Patch for 3.5 also 
adds better error messages for wrong argument types of posixpath.join (of 
course we can apply it to 3.4 too).

--
components: Library (Lib)
files: posixpath_join_bytearray-3.4.diff
keywords: patch
messages: 223654
nosy: hynek, ncoghlan, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: posixpath.join() and bytearray
type: behavior
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36028/posixpath_join_bytearray-3.4.diff

___
Python tracker 

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



[issue22034] posixpath.join() and bytearray

2014-07-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Added file: http://bugs.python.org/file36029/posixpath_join_bytearray-3.5.diff

___
Python tracker 

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



[issue22026] 2.7.8 ttk Button text display problem

2014-07-22 Thread Les Bothwell

Les Bothwell added the comment:

In my example, the import statement can be removed (dammit)

--

___
Python tracker 

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



[issue15275] isinstance is called a more times that needed in ntpath

2014-07-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is alternative patch. I believe it makes a code simpler.

Microbenchmarks:

$ ./python -m timeit -n 10 -s "from ntpath import splitdrive"  
"splitdrive('c:foo')"

Before: 10 loops, best of 3: 20 usec per loop
After: 10 loops, best of 3: 11.5 usec per loop

$ ./python -m timeit -n 10 -s "from ntpath import splitext"  
"splitext('python.exe')"

Before: 10 loops, best of 3: 23.6 usec per loop
After: 10 loops, best of 3: 18 usec per loop

$ ./python -m timeit -s "from ntpath import join"  "join('foo', 'bar')"

Before: 1 loops, best of 3: 50.9 usec per loop
After: 1 loops, best of 3: 32.3 usec per loop

$ ./python -m timeit -s "from ntpath import normpath"  
"normpath('/foo/bar/baz')"

Before: 1 loops, best of 3: 67.5 usec per loop
After: 1 loops, best of 3: 40.3 usec per loop

$ ./python -m timeit -s "from ntpath import relpath"  "relpath('foo', 'bar')"

Before: 1000 loops, best of 3: 695 usec per loop
After: 1000 loops, best of 3: 456 usec per loop

--
nosy: +serhiy.storchaka
versions: +Python 3.5 -Python 3.4
Added file: http://bugs.python.org/file36030/ntpath_cleanup.diff

___
Python tracker 

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



[issue15275] isinstance is called a more times that needed in ntpath

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

I like ntpath_cleanup.diff, I don't think that it makes the code worse.

FYI os.fsencode() accepts str too, you can simplify:

 if isinstance(path, bytes):
-userhome = userhome.encode(sys.getfilesystemencoding())
+userhome = os.fsencode(userhome)

to


+userhome = os.fsencode(userhome)

--
nosy: +haypo

___
Python tracker 

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



[issue22035] Fatal error in dbm.gdbm

2014-07-22 Thread Serhiy Storchaka

New submission from Serhiy Storchaka:

It is possible to crash Python by breaking opened gdbm database.

>>> import _gdbm as dbm
>>> db = dbm.open('x.db', 'n')
>>> open('x.db', 'wb').close()
>>> db[b'a'] = b'b'
gdbm fatal: read error

Proposed patch tries to convert fatal gdbm into regular exception or in Python 
fatal error (which at least produces traceback).

>>> import _gdbm as dbm
>>> db = dbm.open('x.db', 'n')
>>> open('x.db', 'wb').close()
>>> db[b'a'] = b'b'
Traceback (most recent call last):
  File "", line 1, in 
_gdbm.error: gdbm fatal: read error

--
components: Extension Modules
files: dbm_gdbm_fatal_error.patch
keywords: patch
messages: 223658
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Fatal error in dbm.gdbm
type: crash
versions: Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36031/dbm_gdbm_fatal_error.patch

___
Python tracker 

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



[issue17665] convert test_wsgiref to idiomatic unittest code

2014-07-22 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
versions: +Python 3.5 -Python 3.3

___
Python tracker 

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



[issue21859] Add Python implementation of FileIO

2014-07-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Next iteration of the patch addressed Victor's comments.

--
Added file: http://bugs.python.org/file36032/pyio_fileio_4.patch

___
Python tracker 

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



[issue22031] Hexadecimal id in reprs

2014-07-22 Thread Steven D'Aprano

Steven D'Aprano added the comment:

> Many specialized reprs follow a pattern <... at {hexadecimal id}...>. 
> But there are few deviations:
[...]
> Proposed patch makes these cases to conform with other reprs.

I oppose making this change. The exact format of this generic repr of 
instances is not a part of Python's API, and we should not encourage 
people to think that it must always follow the same pattern or rely on 
that pattern.

Changing the repr risks breaking doctests. That *might* be acceptable if 
there was some obvious benefit to the change, e.g. changing from some 
generic  to a nicer, more useful display. But to 
risk breaking doctests just for consistency with other generic displays 
when that consistency has never been promised is not worth it.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue22031] Hexadecimal id in reprs

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

> Changing the repr risks breaking doctests.

That's why the change was only done in Python 3.5. To port your application to 
Python 3.5, you can modify you doctests to use "..." (ellipsis option of 
doctests).

> That *might* be acceptable if there was some obvious benefit
> to the change,

It's better to have consistent representation of objects. Low-level debuggers 
like gdb uses hexadecimal, not decimal. I'm regulary using gdb, and having the 
memory address in hexadecimal helps.

By the way, you should never rely on the (exact) representation in your unit 
tests :-)

--

___
Python tracker 

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



[issue22032] Use __qualname__ together with __module__

2014-07-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

It broke Python tests (test_traceback and test_unittest), and the patch 
contains fixes for this. Yes, it can break user test if they test nested 
subclasses of classes touched by this patch. This is not very likely, but on 
other hand I don't see what can happen wrong when we will not fix it in 3.4.

--
versions:  -Python 3.4

___
Python tracker 

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



[issue22032] Use __qualname__ together with __module__

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

If an application relies on the exact representation in an unit test, it would 
be annoying to check the minor Python version to support the old and the new 
format.

Using the qualified name is better, but it can wait Python 3.5 IMO. They are 
enough complains that Python breaks backward compatibility, which is true or 
not :-)

--

___
Python tracker 

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



[issue22032] Use __qualname__ together with __module__

2014-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fe3c98313855 by Serhiy Storchaka in branch 'default':
Issue #22032: __qualname__ instead of __name__ is now always used to format
http://hg.python.org/cpython/rev/fe3c98313855

--
nosy: +python-dev

___
Python tracker 

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



[issue22032] Use __qualname__ together with __module__

2014-07-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I agree with you. Thank for your review Victor.

All these issues are precursors to issue22033.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

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



[issue21988] Decrease iterating overhead in timeit

2014-07-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

OK. In any case I don't like this patch, it breaks simplicity and elegance of 
current code.

--

___
Python tracker 

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



[issue22018] Add a new signal.set_wakeup_socket() function

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

New patch to rebase the code and document the new function. It fixed also the 
docstring.

--
Added file: http://bugs.python.org/file36033/signal_socket-3.patch

___
Python tracker 

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



[issue22021] shutil.make_archive() root_dir do not work

2014-07-22 Thread R. David Murray

R. David Murray added the comment:

The point *should* be that if you have something like:

   /home/me/some/directory/my/stuff/a
   /home/me/some/directory/my/stuff/b
   /home/me/some/other/directory

and you set rootdir to '/home/me/some' and 
base_dir='/home/me/some/directory/my' then the file paths in the archive will 
be:

directory/my/stuff/a
directory/my/stuff/b

At least, that's how I read the docs, though as I said they are *not* clear.  
(I can't otherwise imagine any reason to have the root_dir parameter, with that 
name.)

Is this not what happens?

--

___
Python tracker 

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



[issue22033] Subclass friendly reprs

2014-07-22 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue22028] Python 3.4.1 Installer ended prematurely (Windows msi)

2014-07-22 Thread Donald Stufft

Changes by Donald Stufft :


--
nosy: +dstufft

___
Python tracker 

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



[issue22036] Obsolete reference to stringobject in comment

2014-07-22 Thread Martin Matusiak

New submission from Martin Matusiak:

bits shared by the stringobject and unicodeobject implementations (and
possibly other modules, in a not too distant future).

"stringobject" should be "bytesobject"

--
components: Interpreter Core
files: fix_typo_stringlib.diff
keywords: patch
messages: 223669
nosy: numerodix
priority: normal
severity: normal
status: open
title: Obsolete reference to stringobject in comment
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file36034/fix_typo_stringlib.diff

___
Python tracker 

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



[issue22023] PyUnicode_FromFormat is broken on python 2

2014-07-22 Thread Alex Gaynor

Alex Gaynor added the comment:

Reviewed more closely today, I think the docs probably need updating, but 
otherwise this LGTM, massive improvement! Thanks!

--

___
Python tracker 

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



[issue22028] Python 3.4.1 Installer ended prematurely (Windows msi)

2014-07-22 Thread Steve Dower

Steve Dower added the comment:

You can always deselect pip from the installation. Running it separately after 
installation will no doubt show what the actual problem is.

--
nosy: +loewis

___
Python tracker 

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



[issue15275] isinstance is called a more times that needed in ntpath

2014-07-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

No, if *path* is not bytes, *userhome* shouldn't be converted to bytes.

--

___
Python tracker 

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



[issue22037] Poor grammar in asyncio TCP echo client example

2014-07-22 Thread Aaron Hill

New submission from Aaron Hill:

The last sentence in the explanation of the TCP echo client currently reads: 

"At run_until_complete() exit, the loop is no more running, so there is no need 
to stop the loop in case of an error".

The grammar should be improved to something like "...the loop is no longer 
running", or "...the loop has stopped running"

The current documentation can be found here: 
https://docs.python.org/3/library/asyncio-protocol.html#echo-client

--
assignee: docs@python
components: Documentation
messages: 223673
nosy: Aaron1011, docs@python
priority: normal
severity: normal
status: open
title: Poor grammar in asyncio TCP echo client example

___
Python tracker 

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



[issue22025] webbrowser.get(command_line) does not support Windows-style path separators

2014-07-22 Thread Zachary Ware

Changes by Zachary Ware :


--
nosy: +georg.brandl
stage:  -> patch review
versions:  -Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue22026] 2.7.8 ttk Button text display problem

2014-07-22 Thread Zachary Ware

Zachary Ware added the comment:

I believe this is a change in Tk itself, I can get your 2.7.6 result with 
Python 2.7.8+ compiled against Tcl/Tk 8.5.2, and your 2.7.8 result with Python 
2.7.6 compiled against Tcl/Tk 8.5.15.  I would guess that Tk is trying to avoid 
getting glyph in your padding and that you may need to work with centering 
somehow, but that's just wild speculation.

Serhiy, do you have any further insight?

--
nosy: +serhiy.storchaka, zach.ware
resolution:  -> third party
status: open -> pending

___
Python tracker 

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



[issue21665] 2.7.7 ttk widgets not themed

2014-07-22 Thread Zachary Ware

Zachary Ware added the comment:

2.7.8 seems fine and there haven't been any reports about Tkinter not working 
on Win2k yet, so I'll go ahead and change the 2.7 buildbot scripts and close 
the issue.

--
assignee:  -> zach.ware

___
Python tracker 

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



[issue22038] Implement atomic operations on non-x86 platforms

2014-07-22 Thread Vitor de Lima

New submission from Vitor de Lima:

The atomic operations listed in the pyatomic.h header file were implemented 
only for the x86 architecture, this patch uses the atomic bultins available in 
GCC >= 4.7 to implement such operations, allowing it to work properly in other 
platforms.

--
components: Interpreter Core
files: atomic.patch
keywords: patch
messages: 223676
nosy: Vitor.de.Lima
priority: normal
severity: normal
status: open
title: Implement atomic operations on non-x86 platforms
type: enhancement
versions: Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36035/atomic.patch

___
Python tracker 

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



[issue21665] 2.7.7 ttk widgets not themed

2014-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 73fcf00b9e0c by Zachary Ware in branch '2.7':
Closes #21665: Don't use OPTS=noxp or -DWINVER=0x0500 when compiling Tcl/Tk
http://hg.python.org/cpython/rev/73fcf00b9e0c

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



[issue22038] Implement atomic operations on non-x86 platforms

2014-07-22 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +jyasskin, neologix

___
Python tracker 

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



[issue22039] PyObject_SetAttr doesn't mention value = NULL

2014-07-22 Thread Antoine Pitrou

New submission from Antoine Pitrou:

PyObject_SetAttr, when called with value == NULL, actually deletes the 
attribute, but the documentation doesn't say it. It mentions PyObject_DelAttr, 
but it is only a macro and can therefore not be looked up using e.g. ctypes.

--
assignee: docs@python
components: Documentation
messages: 223678
nosy: docs@python, pitrou
priority: normal
severity: normal
status: open
title: PyObject_SetAttr doesn't mention value = NULL
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue22023] PyUnicode_FromFormat is broken on python 2

2014-07-22 Thread Alex Gaynor

Alex Gaynor added the comment:

I've tested in my local dev with my SSL patches applied, and I've confirmed 
that it fixes the segfaults.

--

___
Python tracker 

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



[issue21591] "exec(a, b, c)" not the same as "exec a in b, c" in nested functions

2014-07-22 Thread Guido van Rossum

Guido van Rossum added the comment:

This does appear to be a bug. Please research the C code that originates the 
error message -- there's probably a simple logic mistake.

--
nosy: +gvanrossum

___
Python tracker 

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



[issue22003] BytesIO copy-on-write

2014-07-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

There's also the following code in numpy's getbuffer method:

/*
 * If a read-only buffer is requested on a read-write array, we return a
 * read-write buffer, which is dubious behavior. But that's why this call
 * is guarded by PyArray_ISWRITEABLE rather than (flags &
 * PyBUF_WRITEABLE).
 */
if (PyArray_ISWRITEABLE(self)) {
if (array_might_be_written(self) < 0) {
goto fail;
}
}

... which seems to imply that mmap is not the only one with "dubious behaviour" 
(?).

--

___
Python tracker 

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



[issue22003] BytesIO copy-on-write

2014-07-22 Thread Stefan Krah

Stefan Krah added the comment:

Actually we have an extra safety net in memory_hash() apart from
the readonly check:  We also check if the underlying object is
hashable.

This might be applicable here, too. Unfortunately mmap objects
*are* hashable, leading to some funny results:


>>> import mmap
>>> with open("hello.txt", "wb") as f:
... f.write(b"x\n")
...
6
>>> f = open("hello.txt", "r+b")
>>> mm = mmap.mmap(f.fileno(), 0, prot=mmap.PROT_READ)
>>> x = memoryview(mm)
>>> hash(mm)
-9223363309538046107
>>> hash(x)
-3925142568057840789
>>> x.tolist()
[120, 120, 120, 120, 120, 10]
>>>
>>> with open("hello.txt", "wb") as g:
... g.write(b"yyy\n")
...
4
>>> hash(mm)
-9223363309538046107
>>> hash(x)
-3925142568057840789
>>> x.tolist()
[121, 121, 121, 10, 0, 0]


memoryview (rightfully) assumes that hashable objects are immutable
and caches the first hash.

I'm not sure why mmap objects are hashable, it looks like a bug
to me.

--

___
Python tracker 

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



[issue22003] BytesIO copy-on-write

2014-07-22 Thread Stefan Krah

Stefan Krah added the comment:

I think the mmap behavior is probably worse than the NumPy example.

I assume that in the example the exporter sets view.readonly=0.
mmap objects set view.readonly=1 and can still be mutated.

--

___
Python tracker 

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



[issue14484] missing return in win32_kill?

2014-07-22 Thread Zachary Ware

Zachary Ware added the comment:

It looks like we have a bit of a mess here.  2.7 has a return there (and thus 
doesn't fall back to TerminateProcess if GenerateConsoleCtrlEvent fails), added 
40 commits after the initial implementation in b1c00c7d3c85, but 3.x was never 
changed so 2.7 and 3.x have behaved differently from the the time it was 
implemented.  Which version is right, or is it too late to change either one 
and 3.x should just remove the unused error setting?  An interesting 
possibility might be to convert the signal.CTRL_* values to an enum, and use 
that as a way to distinguish between ``0`` and ``signal.CTRL_C_EVENT``.  I 
suspect that might become rather hairy, though.

Either way, I don't think os.kill can promise much more than "try to make the 
specified process die" on Windows; signals are just so crippled on Windows that 
that's about all you can do with them anyway.  It might not hurt for the docs 
to try to make that clearer.

--

___
Python tracker 

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



[issue22040] Add a "force" parameter to shutil.rmtree

2014-07-22 Thread Paul Moore

New submission from Paul Moore:

It would be useful for shutil.rmtree to have a "force" argument that overrode 
read-only permission issues, essentially replicating the behaviour of the -f 
flag in rm -rf (Unix) and the -force parameter of del (Windows Powershell).

It's possible to use the onerror callback to implement this, but it's tricky to 
get right in a cross-platform manner. See 
http://stackoverflow.com/questions/2656322, which recommends

def onerror(func, path, exc_info):
if not os.access(path, os.W_OK):
os.chmod(path, stat.S_IWUSR)
func(path)
else:
raise

and http://stackoverflow.com/questions/1889597 which recommends

def remove_readonly(func, path, excinfo):
os.chmod(path, stat.S_IWRITE)
func(path)

It's not clear whether either of these is portable, though (the former looks to 
me like it's Unix-specific and the latter like it's for Windows, but I'm not 
sure).

Having the functionality available in the standard library function directly 
avoids having people write tricky and potentially buggy code for what is a 
pretty common situation. (In particular, this comes up a lot in code that 
deletes git checkouts on Windows, where git makes parts of the .git directory 
readonly).

--
components: Library (Lib)
messages: 223685
nosy: pmoore
priority: normal
severity: normal
status: open
title: Add a "force" parameter to shutil.rmtree
type: enhancement
versions: Python 3.5

___
Python tracker 

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



[issue22040] Add a "force" parameter to shutil.rmtree

2014-07-22 Thread Charles-François Natali

Charles-François Natali added the comment:

On Unix at least, this doesn't apply: rm -f doesn't mean "ignore permissions", 
but but rather don't ask confirmation which the rm commands asks in some cases 
(empty file, directory, etc).
Ans the code posted wouldn't work, since the permission to remove a file 
applies to to the file, but to the parent directory (must have write 
permission). And we certainly don't want to change the directory permission 
anyway.

Not sure about Windows, though.

--
nosy: +neologix

___
Python tracker 

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



[issue22040] Add a "force" parameter to shutil.rmtree

2014-07-22 Thread R. David Murray

R. David Murray added the comment:

Actually it does apply on unix:

rdmurray@session:~/tmp>ls -ld foo
drwxr-x--- 2 rdmurray rdmurray 4096 Jul 22 16:09 foo
rdmurray@session:~/tmp>ls -l foo
total 0
-r--r- 1 rdmurray rdmurray 0 Jul 22 16:09 bar
rdmurray@session:~/tmp>rm -r foo
rm: remove write-protected regular empty file ‘foo/bar’? 

If I say yes it will remove it, since I have write perms on the directory.  rm 
-rf will not prompt and will delete it.

I believe the situation is analogous on Windows, but I"m not sure.

--
nosy: +r.david.murray, zach.ware

___
Python tracker 

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



[issue21772] platform.uname() not EINTR safe

2014-07-22 Thread Charles-François Natali

Changes by Charles-François Natali :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> handle EINTR in the stdlib

___
Python tracker 

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



[issue22007] sys.stdout.write on Python 2.7 is not EINTR safe

2014-07-22 Thread Charles-François Natali

Changes by Charles-François Natali :


--
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> handle EINTR in the stdlib

___
Python tracker 

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



[issue22041] http POST request with python 3.3 through web proxy

2014-07-22 Thread Alejandro MJ

New submission from Alejandro MJ:

I'm trying this specific method with python, in order to use a different ip 
source, to do a POST request: 

import http.client, urllib.parse
data = urllib.parse.urlencode({'QLastname': 'DIAZ HERNANDEZ', 'QFirstname': 
'JAIME'})
headers = {"Content-type": "application/x-www-form-urlencoded","Accept": 
"text/plain"}
conn = http.client.HTTPConnection("www.infobel.com",80, 
source_address=("16.19.109.51", 0))
conn.request("POST", "/es/spain/people.aspx", data, headers)
response = conn.getresponse()
print(response.status, response.reason)
data = response.read()
conn.close()

It works perfectly when I test it without a proxy, but when I try with proxy 
connection, I receive this error:

>>> conn.request("POST", "/es/spain/people.aspx", data, headers)
Traceback (most recent call last):
  File "", line 1, in 
  File "C:\Python34\lib\http\client.py", line 1090, in request
self._send_request(method, url, body, headers)
  File "C:\Python34\lib\http\client.py", line 1128, in _send_request
self.endheaders(body)
  File "C:\Python34\lib\http\client.py", line 1086, in endheaders
self._send_output(message_body)
  File "C:\Python34\lib\http\client.py", line 924, in _send_output
self.send(msg)
  File "C:\Python34\lib\http\client.py", line 859, in send
self.connect()
  File "C:\Python34\lib\http\client.py", line 836, in connect
self.timeout, self.source_address)
  File "C:\Python34\lib\socket.py", line 509, in create_connection
raise err
  File "C:\Python34\lib\socket.py", line 500, in create_connection
sock.connect(sa)

TimeoutError: [WinError 10060] Se produjo un error durante el intento...

How could I follow proxy configuration in this script? 

This is the code I made to test with proxy (following the documentation of 
Python):

import http.client, urllib.parse
data = urllib.parse.urlencode({'QLastname': 'DIAZ HERNANDEZ', 'QFirstname': 
'JAIME'})
headers={"Content-Type":"application/x-www-form-urlencoded","Accept":"text/plain"}
conn = http.client.HTTPConnection(proxy_url,8080, source_address=(ipAddress, 0))
conn.set_tunnel("www.infobel.com")
conn.request("POST", "/es/spain/people.aspx", data, headers)
response = conn.getresponse()
print(response.status, response.reason)
data = response.read()
conn.close()

I could't make it work in this SO:
SUSE Linux Enterprise Server 11 (x86_64) VERSION = 11 PATCHLEVEL = 2 

The message that proxy give us is this:

2014-07-22 08:31:49 87 16.19.109.51 23.2.2.22 - - - PROXIED "none" -  200 
TCP_ACCELERATED CONNECT - tcp www.infobel.com 80 / - - - 23.2.2.22 39 39 - 
2014-07-22 08:31:49 1  16.19.109.51 23.2.2.22 - - dns_unresolved_hostname 
PROXIED "none" -  404 TCP_ERR_MISS POST - http cachebdvg1.igrupobbva 8080 
/es/spain/people.aspx - aspx - 23.2.2.22 815 230 - 

So I tried to prove it in other SO, such as Windows, in a different computer. A 
curious thing... I've tried this with Python3.4.1 in Windows, and it didn't 
work. But when I proved with Python3.3.5 it works!! 

Thanks for help.

--
components: Windows
messages: 223688
nosy: AlexMJ
priority: normal
severity: normal
status: open
title: http POST request with python 3.3 through web proxy
type: behavior
versions: Python 3.4, Python 3.5

___
Python tracker 

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



[issue22040] Add a "force" parameter to shutil.rmtree

2014-07-22 Thread Charles-François Natali

Charles-François Natali added the comment:

> Actually it does apply on unix:

No, it does not apply: here's what I've written:
"""
 rm -f doesn't mean "ignore permissions", but but rather don't ask
confirmation which the rm commands asks in some cases (empty file,
directory, etc).
"""

Having a file non-writable fits in those "some cases" where rm is
extra careful and asks confirmation.: calling shutil.rmtree() on your
example will succeed, so it does not apply on Unix.

--

___
Python tracker 

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



[issue22002] Make full use of test discovery in test subpackages

2014-07-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Nice. Could you please comment multiple dirname()-s in load_package_tests() as 
it done for basename in Lib/test/test_tools/__init__.py?

--

___
Python tracker 

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



[issue21901] test_selectors.PollSelectorTestCase.test_above_fd_setsize reported killed by shell

2014-07-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7238c6a05ca6 by Charles-François Natali in branch '3.4':
Issue #21901: Cap the maximum number of file descriptors to use for the test.
http://hg.python.org/cpython/rev/7238c6a05ca6

New changeset 89665cc05592 by Charles-François Natali in branch 'default':
Issue #21901: Cap the maximum number of file descriptors to use for the test.
http://hg.python.org/cpython/rev/89665cc05592

--
nosy: +python-dev

___
Python tracker 

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



[issue22003] BytesIO copy-on-write

2014-07-22 Thread David Wilson

David Wilson added the comment:

Stefan, I like your new idea. If there isn't some backwards compatibility 
argument about mmap.mmap being hashable, then it could be considered a bug, and 
fixed in the same hypothetical future release that includes this BytesIO 
change. The only cost now is that to test for hashability, we must hash the 
object, which causes every byte in it to be touched (aka. almost 50% the cost 
of a copy)

If however we can't fix mmap.mmap due to the interface change (I think that's a 
silly idea -- Python has never been about letting the user shoot themselves in 
the foot), then the specialized-for-Bytes approach is almost as good (and 
perhaps even better, since the resulting concept and structure layout is more 
aligned with Serhiy's patch in issue15381).

tl;dr: 

a) mmap.mmap can be fixed - use hashability as strong test for immutability 
(instead of ugly heuristic involving buffer blags)
   - undecided: is calling hash(obj) to check for immutability too costly?

b) mmap.mmap can't be fixed - use the Bytes specialization approach.

--

___
Python tracker 

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



[issue17293] uuid.getnode() MAC address on AIX

2014-07-22 Thread Charles-François Natali

Charles-François Natali added the comment:

Thanks for the patch, but I'm not even sure AIX is an officially supported 
platform, so I'm not sure what to do with this patch.

--
nosy: +neologix

___
Python tracker 

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



[issue22040] Add a "force" parameter to shutil.rmtree

2014-07-22 Thread R. David Murray

R. David Murray added the comment:

In other words, on unix shutil.rmtree is *already* 'rm -rf'.  This then argues 
that it *not* deleting read only files on Windows is a bug, albeit one we may 
not be able to fix for backward compatibility reasons.

Ah, and now my memory is jogged.  This is a duplicate of issue 19643, and that 
was more or less the conclusion.

--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> shutil rmtree fails on readonly files in Windows

___
Python tracker 

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



[issue21860] Correct FileIO docstrings

2014-07-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
nosy: +haypo

___
Python tracker 

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



[issue21901] test_selectors.PollSelectorTestCase.test_above_fd_setsize reported killed by shell

2014-07-22 Thread Charles-François Natali

Charles-François Natali added the comment:

Sorry for the delay, should be fixed now.

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



[issue17391] _cursesmodule Fails to Build on GCC 2.95 (static)

2014-07-22 Thread Charles-François Natali

Charles-François Natali added the comment:

Jerrfey, thanks for your patch, but apparently in the - long - meantime, the 
declaration has already been moved up.

--
nosy: +neologix
resolution:  -> out of date
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



[issue17391] _cursesmodule Fails to Build on GCC 2.95 (static)

2014-07-22 Thread Jeffrey Armstrong

Jeffrey Armstrong added the comment:

Next time I see a bug I'll be sure to wait rather than actually submit a 
patch...

--

___
Python tracker 

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



[issue15275] isinstance is called a more times that needed in ntpath

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

Oh you're right sorry.

--

___
Python tracker 

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



[issue17391] _cursesmodule Fails to Build on GCC 2.95 (static)

2014-07-22 Thread Charles-François Natali

Charles-François Natali added the comment:

> Jeffrey Armstrong added the comment:
>
> Next time I see a bug I'll be sure to wait rather than actually submit a 
> patch...

I understand your frustration, but please don't do that: you have to
understand that we don't have any automatic reminder of issues, so it
can happen that some go unnoticed, especially if no core developer is
assigned.
Is this happens in the future, simply send an email on the python-dev
mailing list saying that you've got a patch waiting for review, this
shoud do the trick.

--

___
Python tracker 

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



[issue22026] 2.7.8 ttk Button text display problem

2014-07-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Indeed. I got different results with different versions of Tk. Here is Tcl 
script which demonstrates this.

--
status: pending -> closed
Added file: http://bugs.python.org/file36036/issue22026.tcl

___
Python tracker 

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



[issue21591] "exec(a, b, c)" not the same as "exec a in b, c" in nested functions

2014-07-22 Thread Neil Muller

Neil Muller added the comment:

Poking at the source of the error suggests the problem is in symtable.c:

The offending logic looks to be (around line 1124 in python 2.7 at revision 
91767:4cef7b0ec659):

if (s->v.Exec.globals) {
   ...
}
else
{
   st->st_cur->ste_unoptimized |= OPT_BARE_EXEC;
}

since OPT_BARE_EXEC is the flag that triggers the exception.

As far as I can see, this makes no provision for the exec() case, and only 
avoids setting OPT_BARE_EXEC if globals is specified using the old syntax.

--
nosy: +Neil Muller

___
Python tracker 

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



[issue22026] 2.7.8 ttk Button text display problem

2014-07-22 Thread Zachary Ware

Changes by Zachary Ware :


--
stage:  -> resolved

___
Python tracker 

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



[issue22040] Add a "force" parameter to shutil.rmtree

2014-07-22 Thread Paul Moore

Paul Moore added the comment:

Doh. And I was even involved in the previous issue. Sorry for the noise.

--

___
Python tracker 

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



[issue22040] Add a "force" parameter to shutil.rmtree

2014-07-22 Thread Charles-François Natali

Charles-François Natali added the comment:

> In other words, on unix shutil.rmtree is *already* 'rm -rf'.

Exactly :-)

--

___
Python tracker 

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



[issue13299] namedtuple row factory for sqlite3

2014-07-22 Thread Mark Lawrence

Mark Lawrence added the comment:

I'd like to see this in 3.5 as I often use sqlite so what needs doing here?

--
nosy: +BreamoreBoy
versions: +Python 3.5 -Python 3.4

___
Python tracker 

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



[issue17293] uuid.getnode() MAC address on AIX

2014-07-22 Thread David Edelsohn

David Edelsohn added the comment:

Huh?  What does officially supported platform mean? CPython builds and runs on 
AIX.

--

___
Python tracker 

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



[issue12378] smtplib.SMTP_SSL leaks socket connections on SSL error

2014-07-22 Thread Milan Oberkirch

Milan Oberkirch added the comment:

I agree that there is not much we can do on the server side (see issue 19806) 
and with the fix for issue 19662 the server won't recognize this error at all 
(patiently waiting for b'\r\n\' which is unlikely to appear in the first 
handshake-message from the client).

Attached is a smtplib patch for 3.x.

--
nosy: +jesstess, zvyn
Added file: http://bugs.python.org/file36037/issue12378_py35.patch

___
Python tracker 

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



[issue22003] BytesIO copy-on-write

2014-07-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't like the idea of trying to hash the object. It may be a time-consuming 
operation, while the result will be thrown away.

I think restricting the optimization to bytes objects is fine. We can whitelist 
other types, such as memoryview.

--

___
Python tracker 

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



[issue22018] Add a new signal.set_wakeup_socket() function

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

I talked with Charles-François. He doesn't like the idea of a new function 
because it would be harder to write portable code: which function should be 
used? signal.set_wakeup_fd() already works with sockets on UNIX.

Here is a new patch version 4 which tries to combine previous patchs:

- don't touch anything to existing code on UNIX. Keep the sig_atomic_t type for 
wakeup_fd and continue to use write() on sockets.

- on Windows, use a new "wakeup" structure to store the file descriptor or 
socket handle (use the  SOCKET_T type) and the last send() errors (errno and 
GetLastError())

- on Windows, use getsockopt(fd, SOL_SOCKET, SO_ERROR, ...) to check if fd is a 
socket: the function fails with WSAENOTSOCK if fd is not a socket.

- on Windows, PySignal_SetWakeupFd() only supports file descriptors. The 
function returns -1 if signal.set_wakeup_fd() was called with a socket handler, 
because the return type (int) is too small to store a socket handle (need type 
SOCKET_T) and we cannot change the prototype of this public API.

Reminder: the purpose of the whole patch is to be able to wakeup an event loop 
based on select.select() on Windows. select() only supports sockets on Windows.

Notes:

- we still need to add a dependency to the WinSock library

- the test are still skipped on Windows, I will work on a new patch to make the 
file descriptor or socket non-blocking and to run more wakeup fd tests on 
Windows

- if send() fails twice, the error is only reported once until 
report_wakeup_send_error() is called to consume the error. Anything, if send() 
failed, it will probably fail again quickly, there is no need to flood the 
terminal with these errors.

--
Added file: http://bugs.python.org/file36038/signal_socket-4.patch

___
Python tracker 

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



[issue22018] Add a new signal.set_wakeup_socket() function

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

I tried to modify signal.set_wakeup_socket() to automatically make the file 
descriptor non-blocking. Problem: fcntl() function and O_NONBLOCK flag don't 
exist on Windows. Non-blocking operations are only supported for sockets...

Calling a blocking function (write()) in a signal handler will probably block 
the application. So I don't think that it makes sense to support files in 
signal.set_wakeup_fd() on Windows. I guess that nobody used this function on 
Windows in fact.

I can probably simplify my patch to only support sockets on Windows.

--

___
Python tracker 

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



[issue22042] signal.set_wakeup_fd(fd): set the fd to non-blocking mode

2014-07-22 Thread STINNER Victor

New submission from STINNER Victor:

I think that signal.set_wakeup_fd(fd) must set the file descriptor to the 
non-blocking mode, instead of requiring the file descriptor mode to be 
non-blocking.

Atttached patch implements this idea.

See also the issue #22018 which proposes to support sockets in 
signal.set_wakeup_fd(fd) on Windows.

We have to decide if signal.set_wakeup_fd() is supposed to support files or not 
on Windows. Non-blocking mode does not exist for files on Windows, only for 
sockets.

I didn't test my patch on Windows yet.

Note: the new _Py_set_blocking() function tries to use ioctl() instead of 
fnctl() when available to only use one syscall instead of two. I used the same 
optimization in _Py_set_inheritable().

--
files: signal_nonblock.patch
keywords: patch
messages: 223710
nosy: haypo
priority: normal
severity: normal
status: open
title: signal.set_wakeup_fd(fd): set the fd to non-blocking mode
versions: Python 3.5
Added file: http://bugs.python.org/file36039/signal_nonblock.patch

___
Python tracker 

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



[issue22042] signal.set_wakeup_fd(fd): set the fd to non-blocking mode

2014-07-22 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +neologix

___
Python tracker 

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



[issue21955] ceval.c: implement fast path for integers with a single digit

2014-07-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Please run the actual benchmark suite to get interesting numbers: 
http://hg.python.org/benchmarks

--
nosy: +pitrou

___
Python tracker 

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



[issue22042] signal.set_wakeup_fd(fd): set the fd to non-blocking mode

2014-07-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I think it would be much better to expose a generic function to make a fd 
non-blocking, rather than bake it inside signal.set_wakeup_fd().

Also, given set_wakeup_fd() is rather specialized and uncommon, I don't see 
much point in making it more convenient.

--
nosy: +pitrou

___
Python tracker 

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



[issue21933] Allow the user to change font sizes with the text pane of turtledemo

2014-07-22 Thread Lita Cho

Lita Cho added the comment:

I've added it so that if the OS is Mac, it will use Command-minus and 
Command-=. If it is on Windows, it uses Ctrl-minus and Ctrl-= (I wasn't sure if 
Windows uses shift sa well, but I don't think it does.)

When I tried the "pinch" movement in Mac, the MouseWheel event didn't trigger 
at all. It is only when I did the scroll (for me two fingers moving downward or 
upward) movement is when that event triggered. 

I currently have it so that when Control+MouseWheel makes the font size move. 
Let me know what you think.

I can also try adding a widget so that the user can change the font through the 
GUI.

--
Added file: http://bugs.python.org/file36040/window_pane_font_size_v2.patch

___
Python tracker 

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



[issue21867] Turtle returns TypeError when undobuffer is set to 0 (aka no undo is allowed)

2014-07-22 Thread Lita Cho

Lita Cho added the comment:

This is now fixed due to a patch in issue21868.

--
resolution:  -> fixed

___
Python tracker 

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



[issue22043] Use a monotonic clock to compute timeouts

2014-07-22 Thread STINNER Victor

New submission from STINNER Victor:

Currently, socket methods (ex: accept, recv, recvfrom, recvmsg, send, sendto, 
sendmsg), threading.Lock.acquire() and threading.RLock.acquire() use the system 
clock to compute their timeout. It's fine for the first call. But if the call 
is interrupted and the timeout need to be recomputed, it can wait too short or 
too long. Timeouts must use a monotonic clock, not the system clock. See the 
PEP 418 for more information.

Python modules were already patched to use the time.monotonic() function 
implemented in Python 3.3.

Attached patch fixes also functions which still use the system clock to compute 
timeouts.

A major change of the patch is that a monotonic clock is now require to use 
Python 3.5. Last time I checked, there was only one OS without monotonic clock: 
GNU Hurd. Hurd maintainers can patch Python 3.5 to fallback on the system clock 
until Hurd provides a monotonic clock.

Another important change is that Python now depends on the librt on Solaris and 
on Linux with glibc older than 2.17 (clock_gettime is now available directly in 
the libc since glibc 2.17).

--
files: pymonotonic.patch
keywords: patch
messages: 223715
nosy: haypo
priority: normal
severity: normal
status: open
title: Use a monotonic clock to compute timeouts
type: enhancement
versions: Python 3.5
Added file: http://bugs.python.org/file36041/pymonotonic.patch

___
Python tracker 

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



[issue22043] Use a monotonic clock to compute timeouts

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

On FreeBSD and OpenBSD, clock_gettime() is directly available in the libc.

--

___
Python tracker 

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



[issue22042] signal.set_wakeup_fd(fd): set the fd to non-blocking mode

2014-07-22 Thread STINNER Victor

STINNER Victor added the comment:

"Also, given set_wakeup_fd() is rather specialized and uncommon, I don't see 
much point in making it more convenient."

The problem is that passing a blocking file descriptor can block the whole 
Python process. The hang does not occur immediatly, but only when the pipe is 
full for example, which may only occur in some corner cases (ex: heavy system 
load, slow network, etc.).

The minimum would be to raise an error if the file descriptor is in blocking 
mode.

--

___
Python tracker 

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



  1   2   >