[issue22629] Idle: update htest.py and hests

2014-10-13 Thread Terry J. Reedy

New submission from Terry J. Reedy:

After using idle-test/htest.py and individual htests when editing files, a few 
updates are needed.

1. Improve the docstring for htest.py; add info about "# htest #" and #2 below.

2. Use Toplevel(parent) instead of Tk() for test-specific childs windows of the 
main, master window.  Currently, for some tests, such as CallTipWindow, the 
focus does not properly shift to the test window. Closing the master window 
first leaves the test window open.  Closing the test window second then causes 
several tcl errors (printed to console if available), a Windows message, and an 
Idle freeze of 5 seconds or more before Idle works again.  The change in this 
initial patch fixes the focus, non-close, error, and hang problems.  One click 
and the test window is ready to go; one click on the master and both go away.

3. Coding style issues -- I prefer to use winfo_rootx/y, as done elsewhere in 
Idle, to using re (close call).  For CallTipWindow, the inner class is not 
needed now, if it ever was.

--
components: IDLE
files: @htest-34.diff
keywords: patch
messages: 229278
nosy: sahutd, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: Idle: update htest.py and hests
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36906/@htest-34.diff

___
Python tracker 

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



[issue22628] Idle: Tree lines are spaced too close together.

2014-10-13 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
components: +IDLE

___
Python tracker 

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



[issue22628] Idle: Tree lines are spaced too close together.

2014-10-13 Thread Terry J. Reedy

New submission from Terry J. Reedy:

(Mentioned on #16233) At least on my windows 7 system, the lines of 
idlelib.TreeWidget, used for Path Browser and Class (Module) Browser, are 
spaced too narrowly.  They are so close together that they overlap and each 
cuts off enough of the line above to make reading difficult.

TreeWidget is actually a canvas painted with icons, connecting lines, and lines 
of text. There is no automatic spacing of text lines as with tkinter.Text.  A 
comment in the draw method notes "XXX This hard-codes too many geometry 
constants!".

The attached patch changes two of the constants.  Increasing dy spreads the 
line apart a bit so there is very little clipping. (Both g and y are sometimes 
complete, sometimes not.) The other change moves the lines up relative to the 
icons so they are not offset.

Saimadhav, does this change look ok on linux?

I think the long term fix (before 3.5) is to use ttk.Treeview.  So I am not 
inclined to spend lots of time fine-tuning on various systems or adding user 
configuration (though we might for Treeview).  However, dy could be made 
conditional on, for instance, sys.platform[0:3] == 'win'.

--
assignee: terry.reedy
files: atree.diff
keywords: patch
messages: 229277
nosy: sahutd, terry.reedy
priority: normal
severity: normal
stage: patch review
status: open
title: Idle: Tree lines are spaced too close together.
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5
Added file: http://bugs.python.org/file36905/atree.diff

___
Python tracker 

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



[issue22627] Calling timestamp() on a datetime object modifies the timestamp of a different datetime object.

2014-10-13 Thread Barry A. Warsaw

Changes by Barry A. Warsaw :


--
nosy: +barry

___
Python tracker 

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



[issue22627] Calling timestamp() on a datetime object modifies the timestamp of a different datetime object.

2014-10-13 Thread Christopher Lee

New submission from Christopher Lee:

I have an example script here[1].
This script creates 2 datetime objects (using a timedelta work around to deal 
with large timestamps).
It then makes 2 assertions, that the timestamp of the created object is the 
same as the one that was used to create it. (when run with no arguments this 
script passes both assertions).
However, if the argument 'breakme' is passed to the script then after the first 
assertion the method 'timestamp()' is called on a different (un-asserted) 
datetime which will now make the 2nd assertion fail.

[1] http://paste.ubuntu.com/8556130/

--
components: Library (Lib)
messages: 229276
nosy: thomir, veebers
priority: normal
severity: normal
status: open
title: Calling timestamp() on a datetime object modifies the timestamp of a 
different datetime object.
type: behavior
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



[issue22621] Please make it possible to make the output of hash() equal between 32 and 64 bit architectures

2014-10-13 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> some libraries I use rely on the order of items in Python dictionaries for 
> their output

Your choices are:

* create a custom hash function using __hash__
* or sort the output from within Python
* or sort the output externally, prior to diffing.

> From my perspective it would be nice to just be able 
> to set PYTHONHASH32BIT 

The odds of this being accepted are almost zero.
We're moving in the opposite direction of randomizing
the hash from run-to-run.

--
nosy: +rhettinger

___
Python tracker 

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



[issue5159] Indicating packages to be loaded when a Tcl interpreter is created in tkinter

2014-10-13 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +serhiy.storchaka
stage:  -> patch review
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



[issue22625] When cross-compiling, don’t try to execute binaries

2014-10-13 Thread Georg Brandl

Georg Brandl added the comment:

Indeed, that is an issue :(

--
nosy: +doko

___
Python tracker 

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



[issue22621] Please make it possible to make the output of hash() equal between 32 and 64 bit architectures

2014-10-13 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
status: open -> closed

___
Python tracker 

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



[issue22624] Bogus usage of floatclock in timemodule

2014-10-13 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +haypo

___
Python tracker 

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



[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2014-10-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
keywords: +easy
stage:  -> needs patch

___
Python tracker 

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



[issue22625] When cross-compiling, don’t try to execute binaries

2014-10-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This was removed in c2a53aa27cad, to fix #22359.

--

___
Python tracker 

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



[issue17582] xml.etree.ElementTree does not preserve whitespaces in attributes

2014-10-13 Thread Daniele Varrazzo

Daniele Varrazzo added the comment:

No, I cannot. I take the fact there has been no answer for more than 18 months 
as an acknowledgement that the issue is not deemed important by Python 
maintainers: it's not important for me either. I'm not a heavy xml user: just 
knowing that the Python XML libraries are unreliable and that by default I 
should use lxml is a sufficient solution to my sporadic xml uses. Your mileage 
should vary.

--

___
Python tracker 

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



[issue22626] Documentation should point people to bugs. over HTTPS

2014-10-13 Thread Ezio Melotti

Changes by Ezio Melotti :


--
stage:  -> resolved
type:  -> enhancement

___
Python tracker 

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



[issue22625] When cross-compiling, don’t try to execute binaries

2014-10-13 Thread Link Mauve

Link Mauve added the comment:

Thanks, this patch worked fine. :)

I used to build pgen natively first, then make distclean and rebuild until it 
failed, and then put the native version back here, but this works much better!

--

___
Python tracker 

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



[issue22626] Documentation should point people to bugs. over HTTPS

2014-10-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7bb901d68be0 by Alex Gaynor in branch '2.7':
issue22626: Use https:// for a link to the bug tracker
https://hg.python.org/cpython/rev/7bb901d68be0

--

___
Python tracker 

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



[issue22626] Documentation should point people to bugs. over HTTPS

2014-10-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 552f2d558e78 by Alex Gaynor in branch '3.4':
issue22626: Use https:// for a link to the bug tracker
https://hg.python.org/cpython/rev/552f2d558e78

--

___
Python tracker 

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



[issue3068] IDLE - Add an extension configuration dialog

2014-10-13 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Saimadhav could not apply cfg-ext-34.diff, so uploading again, also with 
line-end whitespace removed. OSX test still needed.

--
Added file: http://bugs.python.org/file36904/cfg-ext-34-2.diff

___
Python tracker 

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



[issue22559] [backport] ssl.MemoryBIO

2014-10-13 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue22626] Documentation should point people to bugs. over HTTPS

2014-10-13 Thread Alex Gaynor

Changes by Alex Gaynor :


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



[issue22626] Documentation should point people to bugs. over HTTPS

2014-10-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset b3bd4a65b45b by Alex Gaynor in branch 'default':
issue22626: Use https:// for a link to the bug tracker
https://hg.python.org/cpython/rev/b3bd4a65b45b

--
nosy: +python-dev

___
Python tracker 

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



[issue22626] Documentation should point people to bugs. over HTTPS

2014-10-13 Thread Alex Gaynor

New submission from Alex Gaynor:

Very simple patch.

--
assignee: docs@python
components: Documentation
files: https.diff
keywords: patch
messages: 229266
nosy: alex, docs@python
priority: normal
severity: normal
status: open
title: Documentation should point people to bugs. over HTTPS
versions: Python 3.5
Added file: http://bugs.python.org/file36903/https.diff

___
Python tracker 

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



[issue1610654] cgi.py multipart/form-data

2014-10-13 Thread Rishi

Rishi added the comment:

Antoine, I will upload a patch that relies on BufferedReader. As you mentioned, 
it will get rid of supporting the buffer and reduce a lot of code.
The only issue is that it helps me to know if the current buffer is at EOF (the 
documentation of peek does not mention  guaranteeing Eof if buffer returned is 
less than what we expect), because patterns at EOF are different, but I think I 
can work around that.

--

___
Python tracker 

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



[issue22625] When cross-compiling, don’t try to execute binaries

2014-10-13 Thread Georg Brandl

Georg Brandl added the comment:

You're right, this can be avoided (although you will also have to patch the 
extension module build, which uses the just-built python executable).

This problem occurs twice in the build process, once for pgen and once for 
_freeze_importlib.  The problem is that the Makefile rules for the generated 
files depend on the binary (which is of course not checked in and cannot be 
touched by "make touch").

Attached patch should fix this.

--
keywords: +patch
nosy: +benjamin.peterson, georg.brandl, pitrou
Added file: http://bugs.python.org/file36902/makefile-regen-fix.patch

___
Python tracker 

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



[issue22621] Please make it possible to make the output of hash() equal between 32 and 64 bit architectures

2014-10-13 Thread Ethan Furman

Ethan Furman added the comment:

Like Georg I am sympathetic to the problem, but this is not the correct 
solution.

You might post a question on python-list to see if a usable, not-to-painful 
solution can be found.

--
nosy: +ethan.furman
status: pending -> open

___
Python tracker 

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



[issue1610654] cgi.py multipart/form-data

2014-10-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Rishi, thanks for the patch. I was going to give a review but first I have to 
ask: is so much support code necessary for this?

Another approach would be to wrap self.fp in a io.BufferedReader (if it's not 
already buffered) and then use the peek() method to find the boundary without 
advancing the file pointer.

--
nosy: +serhiy.storchaka
stage: needs patch -> patch review
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



[issue22625] When cross-compiling, don’t try to execute binaries

2014-10-13 Thread Link Mauve

New submission from Link Mauve:

```
% make
./Programs/_freeze_importlib \
./Lib/importlib/_bootstrap.py Python/importlib.h
./Programs/_freeze_importlib: ./Programs/_freeze_importlib: cannot execute 
binary file
Makefile:710: recipe for target 'Python/importlib.h' failed
make: *** [Python/importlib.h] Error 126
```

I tried `make touch` as it was suggested to me on #python-dev, but it didn’t 
fix that issue.

--
components: Cross-Build
messages: 229261
nosy: Link Mauve
priority: normal
severity: normal
status: open
title: When cross-compiling, don’t try to execute binaries
type: compile error
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



[issue22624] Bogus usage of floatclock in timemodule

2014-10-13 Thread Link Mauve

New submission from Link Mauve:

In Modules/timemodule.c, py_process_time() still uses floatclock() even when 
HAVE_CLOCK isn’t defined.

--
components: Build
messages: 229260
nosy: Link Mauve
priority: normal
severity: normal
status: open
title: Bogus usage of floatclock in timemodule
type: compile error
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



[issue22435] socketserver.TCPSocket leaks socket to garbage collector if server_bind() fails

2014-10-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 9c8016af2ed8 by Charles-François Natali in branch '3.4':
Issue #22435: Fix a file descriptor leak when SocketServer bind fails.
https://hg.python.org/cpython/rev/9c8016af2ed8

New changeset 3bd0f2516445 by Charles-François Natali in branch 'default':
Issue #22435: Fix a file descriptor leak when SocketServer bind fails.
https://hg.python.org/cpython/rev/3bd0f2516445

--

___
Python tracker 

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



[issue14102] argparse: add ability to create a man page

2014-10-13 Thread Aaron Meurer

Changes by Aaron Meurer :


--
nosy: +Aaron.Meurer

___
Python tracker 

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



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2014-10-13 Thread Antoine Pitrou

Changes by Antoine Pitrou :


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



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2014-10-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fded07a2d616 by Antoine Pitrou in branch 'default':
Issue #17636: Circular imports involving relative imports are now supported.
https://hg.python.org/cpython/rev/fded07a2d616

--
nosy: +python-dev

___
Python tracker 

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



[issue17636] Modify IMPORT_FROM to fallback on sys.modules

2014-10-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Actually, looking up __package__ would be wrong.

Say I have: from pack.module import foo

and "foo" doesn't exist in pack.module but exists in pack.
Since pack.module.__package__ == "pack", using __package__ would wrongly find 
the "foo" in pack.

--

___
Python tracker 

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



[issue22435] socketserver.TCPSocket leaks socket to garbage collector if server_bind() fails

2014-10-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 437002018d2d by Charles-François Natali in branch '2.7':
Issue #22435: Fix a file descriptor leak when SocketServer bind fails.
https://hg.python.org/cpython/rev/437002018d2d

--
nosy: +python-dev

___
Python tracker 

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



[issue22417] PEP 476: verify HTTPS certificates by default

2014-10-13 Thread Alex Gaynor

Alex Gaynor added the comment:

Patch with the implementation, and initial work on documentation. Needs review 
please, I suspect we need more docs in more places. Feedback please!

--
keywords: +needs review
Added file: http://bugs.python.org/file36901/issue22417.diff

___
Python tracker 

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



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-13 Thread Dmitry Kazakov

Changes by Dmitry Kazakov :


--
hgrepos:  -275

___
Python tracker 

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



[issue21991] The new email API should use MappingProxyType instead of returning new dicts.

2014-10-13 Thread R. David Murray

R. David Murray added the comment:

The principle example is the 'params' dictionary in headerregistry.  Currently 
it gets recreated every time you access that attribute.  You can *apparently* 
change it, but that has no real effect.  Probably the computed value should be 
cached the first time the attribute is accessed, and a MappingProxy over the 
cached value returned.

--

___
Python tracker 

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



[issue22594] Add a link to the regex module in re documentation

2014-10-13 Thread Georg Brandl

Georg Brandl added the comment:

"currently more bugfree and intended to replace re"

The first part is spreading FUD if not explained in more detail.  The second is 
probably never going to happend :(

--
nosy: +georg.brandl

___
Python tracker 

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



[issue21907] Update Windows build batch scripts

2014-10-13 Thread Zachary Ware

Zachary Ware added the comment:

After the last round of changes, the buildbots appear to be mostly happy.  If 
anybody else wants to backport the changes, I'd be happy to review and commit, 
but I'll leave the backporting itself to whoever wants to do it.  In the 
meantime, closing the issue.

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



[issue21991] The new email API should use MappingProxyType instead of returning new dicts.

2014-10-13 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

David,

do you have an example, I am at the CPython sprint in Dublin, and I think I can 
work on this issue.

Thanks

--
nosy: +matrixise

___
Python tracker 

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



[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2014-10-13 Thread Larry Hastings

Larry Hastings added the comment:

FWIW, I agree that it should be fixed:

>>> dict(self=1)
{'self': 1}

--
nosy: +larry

___
Python tracker 

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



[issue22594] Add a link to the regex module in re documentation

2014-10-13 Thread anupama srinivas murthy

anupama srinivas murthy added the comment:

I have added the link and attached the patch below. Could you review it?

Thank you

--
components:  -Regular Expressions
keywords: +patch
nosy: +anupama.srinivas.murthy
Added file: http://bugs.python.org/file36900/regex-link.patch

___
Python tracker 

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



[issue22622] ElementTree only writes declaration when passed encoding

2014-10-13 Thread Stefan Behnel

Changes by Stefan Behnel :


--
nosy: +eli.bendersky, scoder

___
Python tracker 

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



[issue22609] Constructors of some mapping classes don't accept `self` keyword argument

2014-10-13 Thread Ethan Furman

Ethan Furman added the comment:

Code looks good.

Only downside is the change in help and inspect.signature output, but that is 
minor:

Help on dict object:
class dict(object)
 [...]
|  __init__(self, /, *args, **kwargs)

  vs.

Help on class Counter in module collections:
class Counter(builtins.dict)
 [...]
|  __init__(*args, **kwds)

+1 to accept.

--

___
Python tracker 

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



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-13 Thread Dmitry Kazakov

Changes by Dmitry Kazakov :


--
hgrepos:  -277

___
Python tracker 

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



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-13 Thread Dmitry Kazakov

Changes by Dmitry Kazakov :


Added file: http://bugs.python.org/file36899/9cb7aaad1d85.diff

___
Python tracker 

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



[issue22619] Possible implementation of negative limit for traceback functions

2014-10-13 Thread Dmitry Kazakov

Dmitry Kazakov added the comment:

Here's the updated (optimized) patch

--
hgrepos: +277

___
Python tracker 

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



[issue21224] BaseHTTPRequestHandler, update the protocol version to http 1.1 by default?

2014-10-13 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

ping

--

___
Python tracker 

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



[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-13 Thread Martin Panter

Martin Panter added the comment:

About the byte sequence comparisons, I wondered if it was misleading to say 
that a list(), tuple() or range() can only be compared to the same type, 
without mentioning that bytes() and bytearray() can be compared to each other.

BTW just noticed you say range() supports lexicographical ordering, which I 
think is incorrect.

--

___
Python tracker 

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



[issue22559] [backport] ssl.MemoryBIO

2014-10-13 Thread Benjamin Peterson

Benjamin Peterson added the comment:

We can reevaluate when we know when 2.7.10 will be released.

--

___
Python tracker 

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



[issue22623] Missing guards for some POSIX functions

2014-10-13 Thread Link Mauve

Changes by Link Mauve :


--
keywords: +patch
Added file: http://bugs.python.org/file36898/f3cf19e38efe.diff

___
Python tracker 

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



[issue22623] Missing guards for some POSIX functions

2014-10-13 Thread Link Mauve

New submission from Link Mauve:

Many POSIX functions aren’t available on every system, especially embedded ones.

The first patch introduces guards around some of these functions and add them 
to AC_CHECK_FUNCS in the configure.ac; the second one recompile every changed 
generated file, using autoreconf -fi and clinic.

--
components: Build
hgrepos: 276
messages: 229243
nosy: Link Mauve
priority: normal
severity: normal
status: open
title: Missing guards for some POSIX functions
type: compile error
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



[issue20079] Add support for glibc supported locales

2014-10-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think there is nothing more to do here and the issue can be closed.

--

___
Python tracker 

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



[issue22615] Argument Clinic doesn't support the "type" argument for the int converter

2014-10-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Thanks, Larry!

--

___
Python tracker 

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



[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-13 Thread Andy Maier

Andy Maier added the comment:

Here is the delta between v9 and v10 of the patch, if people want to see just 
that.

--
Added file: 
http://bugs.python.org/file36897/issue12067-expressions-py34_delta-v9-v10.diff

___
Python tracker 

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



[issue20954] Bug in subprocess._args_from_interpreter_flags causes MemoryError

2014-10-13 Thread Martin Dengler

Martin Dengler added the comment:

Just got hit with this in 2.7.

--

___
Python tracker 

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



[issue20954] Bug in subprocess._args_from_interpreter_flags causes MemoryError

2014-10-13 Thread Martin Dengler

Changes by Martin Dengler :


--
nosy: +mdengler

___
Python tracker 

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



[issue22622] ElementTree only writes declaration when passed encoding

2014-10-13 Thread towb

New submission from towb:

This generates an XML declaration:

import xml.etree.ElementTree as ET

root = ET.Element('rss', version='2.0')
tree = ET.ElementTree(root)
tree.write('test.xml', encoding='iso-8859-1', xml_declaration=True)

However the declaration disappears if your don't pass an encoding. This doesn't 
match the documentation:

xml_declaration controls if an XML declaration should be added to the file. 
Use False for never, True for always, None for only if not US-ASCII or UTF-8 or 
Unicode (default is None).

--
components: Library (Lib)
messages: 229238
nosy: towb
priority: normal
severity: normal
status: open
title: ElementTree only writes declaration when passed encoding
type: behavior
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



[issue22615] Argument Clinic doesn't support the "type" argument for the int converter

2014-10-13 Thread Larry Hastings

Changes by Larry Hastings :


--
assignee:  -> larry
resolution:  -> fixed
status: open -> closed
type:  -> compile error

___
Python tracker 

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



[issue22615] Argument Clinic doesn't support the "type" argument for the int converter

2014-10-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset c0224ff67cdd by Larry Hastings in branch 'default':
Issue #22615: Argument Clinic now supports the "type" argument for the
https://hg.python.org/cpython/rev/c0224ff67cdd

--
nosy: +python-dev

___
Python tracker 

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



[issue22615] Argument Clinic doesn't support the "type" argument for the int converter

2014-10-13 Thread Larry Hastings

Changes by Larry Hastings :


--
title: "make clinic" doesn't work -> Argument Clinic doesn't support the "type" 
argument for the int converter

___
Python tracker 

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



[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-13 Thread Andy Maier

Andy Maier added the comment:

Uploading v10 of the patch, which addresses all review comments made on v9.

There is one open question back to Martin Panter about which different types of 
byte sequences can be compared in Py 3.4.

I also believe this patch addresses all of Issue 22001. Let me know if you find 
that that is not the case.

If we continue to scope this patch to only the comparison chapter of the 
language reference, then I think we are done (see msg229229 about other places 
that need review and possibly updates).

Please review the patch v10.

--
Added file: 
http://bugs.python.org/file36896/issue12067-expressions-py34_v10.diff

___
Python tracker 

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



[issue1610654] cgi.py multipart/form-data

2014-10-13 Thread Rishi

Rishi added the comment:

My observation is that a file with more than normal (exact numbers below) 
line-feed characters takes way too long. 

I tried porting the above patch to my default branch, but it has some boundary 
and CRLF/LF issues, but more importantly it relies on seeking the file-object, 
which in the real world is stdin for web browsers and hence is illegal in that 
environment.

I have attached a patch which is based on the same principle as Chui mentioned, 
ie reading a large buffer, but this patch does not deal with line feeds at all. 
It instead searches the entire boundary in a large buffer.

The cgi module file-object only relies on readline and read functionality - so 
I created a wrapper class around read and readline to introduce buffering 
(attached as patch).
 
When multipart boundaries are being searched, the patch fills a huge buffer, 
like in the original solution. It searches for the entire boundary and returns 
a large chunk of the payload in one call, rather than line by line.

To search, there are corner cases ( when boundary is overlapping between 
buffers) and CRLF issues. A boundary in itself could have repeating characters 
causing more search complexity. 
To overcome this, the patch uses simple regular exressions without any 
expanding or wild characters. If a boundary is not found, it returns the chunk 
- length of the buffer - CRLF prefixes, to ensure that no boundary is 
overlapping between two consecutive buffers. The expressions take care of CRLF 
issues. 

When read and readline are called, the patch looks for data in the buffer and 
returns appropriately.

There is a overall performance improvement in cases of large files, and very 
significant in case of files with very high number of LF characters.

To begin with I created a 20MB file with 20% of the file filled with LineFeeds. 

File - 20MB.bin
size - 20MB
description - file filled with 20% (~4MB) '\n'
Parse time with default cgi module - 53 seconds
Parse time with patch - 0.4s

This time increases linearly with the number of LFs for the default module.ie 
keeping the size same at 20MB and doubling the number of LFs to 40% would 
double the parse time. 

I tried with a normal large binary file that I found on my machine.
size: 88mb
description - binary executable on my machine,
  binary image has 140k lfs.
Parse time with default cgi module - 2.7s
Parse time with patch- 0.7s

I have tested with a few other files and noticed time is cut by atleast half 
for large files.


Note: 
These numbers are consitent over multiple observations.
I tested this using the script attached, and also on my localhost server.
The time taken is obtained by running the following code.

t1=time.time()
cProfile.run("fs = cgi.FieldStorage()")
print(str(len(fs['datafile'].value)))
t2 = time.time()
print(str(t2 - t1))

I have tried to keep the patch compatible with the current module. However I 
have introduced a ValueError excepiton in the module when boundary is very 
large ie. 1024 bytes. The RFC specifies the maximum length to be 70 bytes.

--
keywords: +patch
nosy: +rishi.maker.forum
Added file: http://bugs.python.org/file36895/issue1610654.patch

___
Python tracker 

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



[issue22390] test.regrtest should complain if a test doesn't remove temporary files

2014-10-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I don't understand why you want to remove more files than before. You may
> open a different issue, or at least explain the rationale.

I thought it would be good idea slightly extend this cleanup while we are 
here. I'm not motivated enough to open a different issue.

Well, here is a patch which removes only TESTFN. It is still improved, uses 
support.unlink and support.rmtree instead of os.unlink and shutil.rmtree.

You can just drop cleanup code at all if you prefer. All is good to me.

> I never see any forgotten test file after running tests, so I don't see why
> you are worried because of them.

This is because regrtest creates temporary directory and goes to it. But when 
you execute Python test directly, test files are created in the current 
directory.

> And with your first patch, we will now
> noticed forgotten files, so we can just fix tests.

But we will noticed only one about test at the time if several tests forgot 
the same file. This will needed several iterations.

--
Added file: http://bugs.python.org/file36894/regrtest_warn_lost_files2.patch

___
Python tracker 

___diff -r 1d5485471457 Lib/test/regrtest.py
--- a/Lib/test/regrtest.py  Mon Oct 13 00:17:23 2014 -0500
+++ b/Lib/test/regrtest.py  Mon Oct 13 11:10:36 2014 +0300
@@ -1031,7 +1031,7 @@ class saved_test_environment:
  # to a thread, so check processes first.
  'multiprocessing.process._dangling', 'threading._dangling',
  'sysconfig._CONFIG_VARS', 'sysconfig._INSTALL_SCHEMES',
- 'support.TESTFN', 'locale', 'warnings.showwarning',
+ 'files', 'locale', 'warnings.showwarning',
 )
 
 def get_sys_argv(self):
@@ -1187,20 +1187,16 @@ class saved_test_environment:
 sysconfig._INSTALL_SCHEMES.clear()
 sysconfig._INSTALL_SCHEMES.update(saved[2])
 
-def get_support_TESTFN(self):
-if os.path.isfile(support.TESTFN):
-result = 'f'
-elif os.path.isdir(support.TESTFN):
-result = 'd'
-else:
-result = None
-return result
-def restore_support_TESTFN(self, saved_value):
-if saved_value is None:
-if os.path.isfile(support.TESTFN):
-os.unlink(support.TESTFN)
-elif os.path.isdir(support.TESTFN):
-shutil.rmtree(support.TESTFN)
+def get_files(self):
+return sorted(fn + ('/' if os.path.isdir(fn) else '')
+  for fn in os.listdir())
+def restore_files(self, saved_value):
+fn = support.TESTFN
+if fn not in saved_value and (fn + '/') not in saved_value:
+if os.path.isfile(fn):
+support.unlink(fn)
+elif os.path.isdir(fn):
+support.rmtree(fn)
 
 _lc = [getattr(locale, lc) for lc in dir(locale)
if lc.startswith('LC_')]
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22590] math.copysign buggy with nan under Windows

2014-10-13 Thread Mark Dickinson

Changes by Mark Dickinson :


--
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue22417] PEP 476: verify HTTPS certificates by default

2014-10-13 Thread Raúl Cumplido

Changes by Raúl Cumplido :


--
nosy: +raulcd

___
Python tracker 

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



[issue22590] math.copysign buggy with nan under Windows

2014-10-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Yep, it's ok.

--

___
Python tracker 

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



[issue22590] math.copysign buggy with nan under Windows

2014-10-13 Thread Mark Dickinson

Mark Dickinson added the comment:

Antoine: is it okay to close this as "wont fix"?

--
assignee:  -> mark.dickinson

___
Python tracker 

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



[issue22001] containers "same" does not always mean "__eq__".

2014-10-13 Thread Andy Maier

Andy Maier added the comment:

I reviewed the issues discussed here and believe that the patch for #Issue 
12067 adresses all of them (and yes, it is large, unfortunately).
It became large because I think that more needed to be fixed. May I suggest to 
review that patch.

Andy

--
nosy: +andymaier

___
Python tracker 

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



[issue22599] traceback: errors in the linecache module at exit

2014-10-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

There is one downside of my solution. For now the code uses current builtin 
open() which can be overloaded (to handle reading from ZIP archive for example, 
or to check permissions). With my solution it uses builtin open() at the time 
of import. I don't know insofar current behavior is intentional. We should take 
a decision of yet one core developer.

--

___
Python tracker 

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



[issue12067] Doc: remove errors about mixed-type comparisons.

2014-10-13 Thread Andy Maier

Andy Maier added the comment:

@Guido:
Agree to all you said in your #msg226496.

There is additional information about comparison in:
- Tutorial (5.8. Comparing Sequences and Other Types),
- Library Reference (5.3. Comparisons),
- Language Reference (3.3.1. Basic customization)
that needs to be reviewed in light of this patch.

I'm just not sure I want to make this patch even larger as it is already, and 
tend to do that in a follow on issue and patch (unless directed otherwise).

Andy

--

___
Python tracker 

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



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-13 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7657cc08d29b by Serhiy Storchaka in branch '2.7':
Fixed the test of issue #13664 on platforms without unicode filenames support.
https://hg.python.org/cpython/rev/7657cc08d29b

--

___
Python tracker 

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



[issue13664] UnicodeEncodeError in gzip when filename contains non-ascii

2014-10-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Ah, ASCII locale...

--

___
Python tracker 

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



[issue22621] Please make it possible to make the output of hash() equal between 32 and 64 bit architectures

2014-10-13 Thread Georg Brandl

Georg Brandl added the comment:

> Would your decision be more favorable if you received a patch implementing 
> this feature?

I'll keep this on "pending" for other devs to weigh in with opinions.

In general, we are not keen on keeping text representations stable, as they do 
not form part of the API.  This is true for exception messages most of all, but 
also the representations of other types change occasionally.  Doctests and 
other test methods that rely on exact output, such as yours, have to adapt to 
that.

The patch wouldn't be difficult to write, but the issue is more that it isn't 
really generally useful (as evidenced by the fact that you are the first to 
request it), and it won't save you a lot of work in any case if you want to 
support existing versions of Python (2.7, 3.x) as well: the new feature could 
only go into 3.5.

--
resolution:  -> rejected
status: open -> pending

___
Python tracker 

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



[issue21986] Idle: disable pickleability of user code objects

2014-10-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> PyShell imports non-idlelib modules, including re, before idlelib modules,
> such as rpc. So the re addition is there, though I strongly doubt that
> compiled regexs are every sent to the user process. 

But we can't guarantee that this alway will be so. Other stdlib modules can 
register picklers, and IDLE can import them in future. This code is not 
protected against future changes in other places of the code.

--

___
Python tracker 

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



[issue22621] Please make it possible to make the output of hash() equal between 32 and 64 bit architectures

2014-10-13 Thread josch

josch added the comment:

Thank you for your quick reply.

Yes, as I wrote above there are ways around it by creating a stable in-memory 
representation and comparing that to a stable in-memory representation of the 
expected output. Since both input are several hundred megabytes in size, this 
would be CPU intensive but do-able. I would've just likeld to avoid treating 
this output in a special way because I also compare other files and it is most 
easy to just md5sum all of the files in one fell swoop.

I started using PYTHONHASHSEED to gain stable output for a certain 
platform/version combination. When I uploaded my package to Debian and it was 
built on 13 different architectures I noticed the descrepancy when the same 
version but different platforms are involved.

>From my perspective it would be nice to just be able to set PYTHONHASH32BIT 
>(or whatever) and call it a day. But of course it is your choice whether you 
>would allow such a "hack" or not.

Would your decision be more favorable if you received a patch implementing this 
feature?

--

___
Python tracker 

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



[issue20567] test_idle causes test_ttk_guionly 'can't invoke "event" command: application has been destroyed' messages from Tk

2014-10-13 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> You left this issue number off your tkinter test updates, such as
> f6f098bdb843.

This is minor change. Actually, it should be done yet in issue22236, I had 
just missed it, because these warnings was produced only in 2.7.

> By using .update_idletasks instead of .update, are you
> assuming that their are no user events, or that they should be ignormed?

There are not only "user" events. When you create or configure some widgets, 
some actions is not executed immediately (in particular changing a theme), but 
they are deferred to the next call of update() or update_idletasks(). When you 
call update_idletasks(), these harmless events are quickly handled without 
errors. This is only known me way to clear events queue.

> I was wondering whether it would be Ok, if not a good idea, to run tests,
> and maybe Idle itself, with NoDefaultRoot.

I support it. There are some places in IDLE or tests which should be fixed, 
they are used default master.

> I cannot use exactly the same design as AbstractTkTest since
> I sometimes do other things in setUp/tearDownClass, but I could define
> create_test_root() and delete_test_root() functions in a support file.

See Lib/tkinter/test/test_tkinter/test_images.py. Image tests do  other things 
in setUpClass/tearDownClass, but calls parent's method too.

--

___
Python tracker 

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



[issue9311] os.access can return bogus values when run as superuser

2014-10-13 Thread Georg Brandl

Changes by Georg Brandl :


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

___
Python tracker 

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