[issue1234674] filecmp.cmp's shallow option

2014-04-21 Thread Steven Barker

Steven Barker added the comment:

A recent Stack Overflow question (http://stackoverflow.com/q/23192359/1405065) 
relates to this bug. The questioner was surprised that filecmp.cmp is much 
slower than usual for certain large files, despite the shallow parameter 
being True.

It is pretty clear to me that the behavior of filecmp.cmp does not match its 
docstring with respect to shallow. Either the docstring should be updated to 
match the existing behavior, or (more likely?) the behavior should change to 
match the docs.

--
components: +Library (Lib) -Extension Modules
nosy: +Steven.Barker
versions: +Python 3.4

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



[issue21320] dict() allows keyword expansion with integer keys, e.g. dict(**{5:'v'})

2014-04-21 Thread Cyphase

New submission from Cyphase:

Python 2.7.6: Affected
Python 3.2.3: Not affected

dict() allows keyword expansion using a dict() with integer keys, whereas 
attempting to do so with most other functions raises a TypeError with the 
message, keywords must be strings. The same thing happens with 
collections.defaultdict(), but not collections.Counter() or 
collections.OrderedDict, presumably because they override dict.__init__().

 old_dict = {'a': 1, 2: 'b'}
 old_dict
{'a': 1, 2: 'b'}
 other_dict = {'c': 3, 4: 'd'}
 other_dict
 new_dict = dict(old_dict, **other_dict)
 new_dict
{'a': 1, 2: 'b', 4: 'd', 'c': 3}

I feel like this must be known, but I didn't find anything with a search.

--
components: Interpreter Core
messages: 216938
nosy: Cyphase
priority: normal
severity: normal
status: open
title: dict() allows keyword expansion with integer keys, e.g. dict(**{5:'v'})
type: behavior
versions: Python 2.7

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



[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-21 Thread Anton Afanasyev

New submission from Anton Afanasyev:

This issue results in redundant memory consumption for e.g. in this case:


from itertools import *

def test_islice():

items, lookahead = tee(repeat(1, int(1e9)))
lookahead = islice(lookahead, 10)

for item in lookahead:
pass

for item in items:
pass

if __name__ == __main__:
test_islice()

This demo is taken from real case where one needs to look ahead input stream 
before processing it. For my PC this demo stops with 'Segmentation fault' 
message after exhausting all PC memory, while running it with patched python 
consumes only 0.1% of memory till the end.

When one uses pure pythonic implementation of itertools.islice() (taken from 
docs), the issue goes away as well, since this implementation doesn't store 
redundant reference to source iterator.


def islice(iterable, *args):
s = slice(*args)
it = iter(xrange(s.start or 0, s.stop or sys.maxint, s.step or 1))
nexti = next(it)
for i, element in enumerate(iterable):
if i == nexti:
yield element
nexti = next(it)


Attaching patch for this issue. Have to change '__reduce__()' method since now 
unpickling of exhausted 'islice()' object cannot return old source iterator.

--
components: Extension Modules
files: patch_3.4_8c8315bac6a8.diff
keywords: patch
messages: 216939
nosy: Anton.Afanasyev, rhettinger
priority: normal
severity: normal
status: open
title: itertools.islice() doesn't release reference to the source iterator when 
the slice is exhausted
type: resource usage
versions: Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file34990/patch_3.4_8c8315bac6a8.diff

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



[issue21321] itertools.islice() doesn't release reference to the source iterator when the slice is exhausted

2014-04-21 Thread Anton Afanasyev

Anton Afanasyev added the comment:

Added patch for 2.7 version (no need to change '__reduce__()' method since it's 
not implemented).

--
Added file: http://bugs.python.org/file34991/issue21321_2.7_e3217efa6edd.diff

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



[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Michael Boldischar

Michael Boldischar added the comment:

Windows 7 64-bit:
python --version
Python 2.7.6

Debian 7 Linux 64-bit:
$ python --version
Python 2.7.3

--

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



[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Michael Boldischar

Michael Boldischar added the comment:

Windows 7 64-bit:
 root.tk.eval('info patchlevel')
'8.5.2'

Debian 7 Linux 64-bit:
root.tk.eval('info patchlevel')
'8.5.11'

--

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




[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread R. David Murray

R. David Murray added the comment:

In order for things to work with a patch gating system, I believe it will be 
the most practical for the news items to be each in a separate file.

--

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



[issue21283] A escape character is used when a REGEXP is an argument of strip string function

2014-04-21 Thread Tito Bouzout

Tito Bouzout added the comment:

Thanks guys for the information! Is still weird to me that the escape character 
is used, but well !  Will remember this bug. 
Kind regards,

--

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Ezio Melotti

Ezio Melotti added the comment:

 Unless one looks carefully, it does not help the problen of merging 
 maintenance bugfix items into a default list that also contains 
 enhancement news not in the maintenance list*.

What if instead of having sections in Misc/NEWS for 
core/library/documentation/etc., we simply make sections for bug fixes and 
enhancements?  Wouldn't this basically solve the conflict problem (assuming 
all/most bug fixes are backported, and new features are only on default)?

--

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



[issue21320] dict() allows keyword expansion with integer keys, e.g. dict(**{5:'v'})

2014-04-21 Thread R. David Murray

R. David Murray added the comment:

2.7 can't be changed for backward compatibility reasons, and python3 enforces 
the restriction in dict, as you observe.

I don't know if a python2 documentation note is worthwhile, but given the 
conversations at pycon about adding additional -3 warnings to 2.7, it seems 
like this is a place such a warning would be justified.

--
nosy: +r.david.murray
stage:  - needs patch

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



[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Zachary Ware

Zachary Ware added the comment:

From some testing, this looks like a Tcl/Tk bug, fixed somewhere between 8.5.9 
and 8.5.11: Python 3.2.5 which shipped with Tcl/Tk 8.5.9 shows this bug; 
Python 3.3.5 which shipped with Tcl/Tk 8.5.11 does not, and Python 2.7 built 
with Tcl/Tk 8.5.11 doesn't show it.  Tcl/Tk 8.6.1 is also free of the bug.

Benjamin, what's your take on updating the version of Tcl/Tk shipped with the 
next Python 2.7 Windows installer?  Updating to a newer 8.5 is just a matter of 
changing paths in the buildbot scripts (and making sure whoever does the 
installer since Martin has retired knows about it); updating to 8.6 also 
requires some minor updates to PCbuild/pyproject.vsprops, but seems to work 
fine.

See also issue20565.

--
nosy: +benjamin.peterson

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



[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Benjamin Peterson

Benjamin Peterson added the comment:

On Mon, Apr 21, 2014, at 8:54, Zachary Ware wrote:
 
 Zachary Ware added the comment:
 
 From some testing, this looks like a Tcl/Tk bug, fixed somewhere between 
 8.5.9 and 8.5.11: Python 3.2.5 which shipped with Tcl/Tk 8.5.9 shows this 
 bug; Python 3.3.5 which shipped with Tcl/Tk 8.5.11 does not, and Python 2.7 
 built with Tcl/Tk 8.5.11 doesn't show it.  Tcl/Tk 8.6.1 is also free of the 
 bug.
 
 Benjamin, what's your take on updating the version of Tcl/Tk shipped with
 the next Python 2.7 Windows installer?  Updating to a newer 8.5 is just a
 matter of changing paths in the buildbot scripts (and making sure whoever
 does the installer since Martin has retired knows about it); updating to
 8.6 also requires some minor updates to PCbuild/pyproject.vsprops, but
 seems to work fine.

Sounds fine to me.

--

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



[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Zachary Ware

Zachary Ware added the comment:

Any opinions on which version to update to?  8.5.11 is easy and available and 
fixes the bug; 8.5.15 is the newest 8.5 but not on svn.python.org; 8.6.1 is 
available and is also what 3.4 (and currently 3.5) ships with.

--

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



[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-21 Thread Iñigo Serna

New submission from Iñigo Serna:

Pathlib .owner() and .group() methods fail on broken symlinks.

They use:
return pwd.getpwuid(self.stat().st_uid).pw_name
and:
return grp.getgrgid(self.stat().st_gid).gr_name

It should be self.lstat().

Attached simple fix as unified diff.

--
components: Library (Lib)
files: pathlib-34-owner_group_fixed.diff
keywords: patch
messages: 216950
nosy: inigoserna
priority: normal
severity: normal
status: open
title: Pathlib .owner() and .group() methods fail on broken links
type: crash
versions: Python 3.4
Added file: http://bugs.python.org/file34992/pathlib-34-owner_group_fixed.diff

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



[issue19771] runpy should check ImportError.name before wrapping it

2014-04-21 Thread R. David Murray

R. David Murray added the comment:

Hmm.  It seems to me that .name not being set is a bug in importlib.  It 
appears that importlib doesn't set it in the 'from x import y' case.  After a 
bit of experimenting at the python prompt, I'm not even sure what that code in 
runpy is *doing* (find_spec('foo.__main__') seems to return None if __main__ 
doesn't exist but foo does).  I'm going to have to leave this to Nick unless I 
find some more time somewhere ;)

--
nosy: +r.david.murray

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



[issue12916] Add inspect.splitdoc

2014-04-21 Thread R. David Murray

R. David Murray added the comment:

It should receive a string.  This is parallel to cleandoc, and I think splitdoc 
should go in the documentation right after cleandoc.

--

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



[issue12916] Add inspect.splitdoc

2014-04-21 Thread Stéphane Wirtel

Stéphane Wirtel added the comment:

I will fix this issue asap, but I was too tired with the travel to Belgium.

Hope to propose patch during this week.

--

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



[issue18401] Tests for pdb import ~/.pdbrc

2014-04-21 Thread R. David Murray

R. David Murray added the comment:

Thanks, Sam.  It is more helpful if the NEWS entry is *not* put in the patch 
given the current state of the tooling.  What's needs to be added is an entry 
in Doc/whatsnew/3.5.

For the new test, you can take advantage of the temp_dir and 
EnvironmentVarGuard helpers in test.support to simplify the code and make it 
more bullet proof.

--

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread R. David Murray

R. David Murray added the comment:

That would probably work for now, but it wouldn't work for the patch gating 
system.  On the other hand, it would sure make it easier to build/check 
whatsnew.

--

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



[issue20962] Rather modest chunk size in gzip.GzipFile

2014-04-21 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +nadeem.vawda, serhiy.storchaka

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



[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Ned Deily

Ned Deily added the comment:

FWIW, ActiveState is shipping 8.5.15 and 8.6.1 in ActiveTcl.  For the OS X 
installers, we have been using 8.5.x (for the 64-bit/32-bit installer) because 
that's also what Apple has been shipping in recent OS X versions.  Serhiy has 
committed a number of fixes in 3.x for Tk 8.6.x; I'm not sure if they are all 
backported to 2.7.  I'm planning to stick with 8.5.x for OS X for 2.7 at least, 
and, with the various bugs in the Cocoa (OS X) Tk port, that means the very 
latest 8.5.15+.

--
nosy: +ned.deily

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



[issue21303] Python 2.7 Spinbox Format Behaves Differently On Windows Versus Linux

2014-04-21 Thread Benjamin Peterson

Benjamin Peterson added the comment:

On Mon, Apr 21, 2014, at 9:38, Zachary Ware wrote:
 
 Zachary Ware added the comment:
 
 Any opinions on which version to update to?  8.5.11 is easy and available
 and fixes the bug; 8.5.15 is the newest 8.5 but not on svn.python.org;
 8.6.1 is available and is also what 3.4 (and currently 3.5) ships with.

It would probably be good to have similar versions in the mac and
windows installers.

--

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Ezio Melotti

Ezio Melotti added the comment:

Also having a list of enhancements and bug fixes might be more meaningful for 
users than a list of core issues vs library issues vs other similar sections.

This could also be done with two separate files, with the new 
features/enhancements file existing only on default and the bug fixes file 
existing across branches.  From there it shouldn't be difficult for the gating 
system to append/prepend/insert the news.

--

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread R. David Murray

R. David Murray added the comment:

That makes the tooling of the gating system harder, though.  If the NEWS can 
just be a file in the patch, we don't have to have any special tooling for it 
in the gating system.

--

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



[issue21323] CGI HTTP server not running scripts from subdirectories

2014-04-21 Thread Konstantin S. Solnushkin

New submission from Konstantin S. Solnushkin:

Somewhere between Python 3.3 and 3.4, a bug was introduced that forbids the 
http.server module, working in CGI server mode, to run scripts residing in 
subdirectories.

This will break existing software that relies on this feature.

How to reproduce the bug:

1. Create a temporary directory and enter it.
2. Create a directory cgi-bin, and then directory test inside cgi-bin.
3. Create a file test.py in cgi-bin/test with the following contents (see 
also attachment to this bug report):

print(Content-type: text/plain

CGI script executed successfully!
)

4. When run, it should print the following:

Content-type: text/plain

CGI script executed successfully!

5. Now, run Python 3.3 in CGI HTTP server mode:

c:\Python33\python.exe -m http.server --cgi 8000

A request to http://localhost:8000/cgi-bin/test/test.py; then produces the 
following in the HTTP server log:

Serving HTTP on 0.0.0.0 port 8000 ...
127.0.0.1 - - [21/Apr/2014 22:59:11] GET /cgi-bin/test/test.py HTTP/1.0 200 -
127.0.0.1 - - [21/Apr/2014 22:59:11] command: c:\Python33\python.exe -u 
C:\TMP\cgi-bin\test\test.py 
127.0.0.1 - - [21/Apr/2014 22:59:11] CGI script exited OK

6. Now, try this with Python 3.4, and the request will fail with the following 
in the log:

C:\TMPc:\Python34\python.exe -m http.server --cgi 8000
Serving HTTP on 0.0.0.0 port 8000 ...
127.0.0.1 - - [21/Apr/2014 23:02:38] code 403, message CGI script is not a 
plain file ('/cgi-bin/test')
127.0.0.1 - - [21/Apr/2014 23:02:38] GET /cgi-bin/test/test.py HTTP/1.0 403 -

This _could_ be related to the change introduced by issue 19435, although I am 
not sure.

Tested with Windows XP SP3.

--
files: test.py
messages: 216960
nosy: k.s.solnushkin
priority: normal
severity: normal
status: open
title: CGI HTTP server not running scripts from subdirectories
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file34993/test.py

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If we put news items in a database keyed by issue number (and I think it 
reasonable that all news-worthy patches should have a tracker issue), then 
there would be no conflicts. (We already avoid simultaneous commits to the same 
issue.) If the database had fields such as the type of issue/patch and the 
component affected, then different queries could create text files sorted 
differently.

We already have such a database with such fields and indexed by issue number -- 
the tracker itself. We could either copy data from the tracker into a separate 
database or add to the tracker a textbox News field that is only editable by 
either by the 'Assigned to' person or perhaps any committer.

I personally would prefer a box that I could fill out when closing the issue. 
(The tracker could even ask for verification when closing a 'fixed' issue with 
a blank news.) News summaries could be extracted at any time by scanning commit 
messages since the last release for issue numbers. A news box on the tracker 
would give people looking at the issue thereafter a quick summary of the result 
of the issue without scanning through all the messages and checking the 
patches. 

Since the issue formatting is being reviewed, I think the issue summary should 
also include the exact releases patched. This would help people to see if an 
issue is only open for a possible backport, It might also help a program 
selecting issues for a news report.

I am, of course, aware that I have glossed over many details.

--

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Moving News items from the repository to the tracker, where I think they 
initially belong anyway, would also remove them as an issue for a future gating 
system.

--

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Zachary Ware

Zachary Ware added the comment:

Terry J. Reedy wrote:
 Moving News items from the repository to the tracker, where I think
 they initially belong anyway, would also remove them as an issue for
 a future gating system.

I think News items are best left in the repository just so that for any given 
snapshot of the repository, you can see what significant changes are present.

--

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread R. David Murray

R. David Murray added the comment:

Yeah, Guido was strongly in favor of that too.

--

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Ezio Melotti

Ezio Melotti added the comment:

Agreed.  Once the gating system is in place nothing prevent us to read the NEWS 
entry either from the patch that is being committed or from a field in the 
tracker and then including it together with the patch once it is approved.

--

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



[issue21324] dbhash leaks random memory fragments to a database

2014-04-21 Thread Marcin Szewczyk

New submission from Marcin Szewczyk:

As stated in the subject. Example is in a remote Git repository:
https://bitbucket.org/wodny/python-dbm-experiments/
It shows how some random data gets into the database (into some gaps between 
keys and values). There is also a C example which hasn't been caught on leaking.

--
components: Library (Lib)
messages: 216966
nosy: wodny
priority: normal
severity: normal
status: open
title: dbhash leaks random memory fragments to a database
type: security
versions: Python 2.7

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



[issue837046] pyport.h redeclares gethostname() if SOLARIS is defined

2014-04-21 Thread Michael Stahl

Michael Stahl added the comment:

(note that i haven't used any Solaris myself since 2011)

* the #ifdef SOLARIS block still exists in current hg checkout
* according to comment http://bugs.python.org/msg18910 the SOLARIS
  macro can not be defined during a build of python itself, so:
  - the #ifdef SOLARIS block does not break build of python itself
  - the #ifdef SOLARIS block has no useful purpose
* the #ifdef SOLARIS block is in a public header that may be
  included by _other_projects_' source files, and if those other
  projects happen to define a SOLARIS macro then they get the breakage
  (as the OOo patch demonstrates)

--

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



[issue21324] dbhash leaks random memory fragments to a database

2014-04-21 Thread Jakub Wilk

Changes by Jakub Wilk jw...@jwilk.net:


--
nosy: +jwilk

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



[issue17552] socket.sendfile()

2014-04-21 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

Attached is a simple benchmark script transmitting a 100MB file. 
On my Linux box sendfile() is almost twice as fast as send():

send()
real 0.0613s
user 0.0100s
sys  0.0900s
total0.1000s

sendfile()
real 0.0318s
user 0.s
sys  0.0500s
total0.0500s

--
Added file: http://bugs.python.org/file34994/bench.py

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

A sequential log of commit messages for a particular branch would give one an 
even better snapshot view of activity since not all commits have news messages 
and even when they do, commit messages sometimes have additional info. But see 
below.

The essence of my proposal is that the ORIGINAL entry of a news item by a human 
be into the tracker where there is no conflict and where it can be seen by 
people looking at the issue. Eliminating that conflict is the subject of this 
issue. After that, items can be mechanically copied wherever desired, 
including, possibly, into a file in the repository. My apology if this part was 
not clear enough.

Such mechanical copying and  re-arranging should not have the conflicts that 
are the subject of this issue. In particular, if the gating system is the only 
entity that edits particular news files (and I propose that there could be more 
than one), it will not have conflicts with other editors. 

Since these would be secondary, derived files, I don't see why any or all 
should be in the hg repository, as opposed to being part of the doc package 
available online along with other derived files. In other words, the hg 
repository is for original master files used to create derivative files nearly 
always not kept in the repository. We do not put .html files derived from 
master .rst files into the repository. So I do not see why files derived from 
hg repository commit messages and the tracker sql repository should go into the 
hg repository either. But I don't especially care if they are.

I doubt Guido favors a system that inhibits commits by making them unnecessariy 
painful and troublesome.

--

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



[issue21225] io.py: Improve docstrings for classes

2014-04-21 Thread R. David Murray

R. David Murray added the comment:

Looks good to me.

--
nosy: +r.david.murray

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



[issue19771] runpy should check ImportError.name before wrapping it

2014-04-21 Thread Luiz Poleto

Changes by Luiz Poleto luiz.pol...@gmail.com:


Added file: http://bugs.python.org/file34995/issue_19771.patch.v2

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



[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-21 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


--
nosy: +pitrou

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



[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Most other Path methods operate on the link target, not the link itself, so I 
don't see why these methods would work otherwise.

--

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



[issue21228] Missing enumeration of HTTPResponse Objects methods of urllib.request.urlopen's http.client.HTTPResponse?

2014-04-21 Thread R. David Murray

R. David Murray added the comment:

That section of the docs is indeed rather confusing.  Probably it just needs to 
be changed to say for the methods supported by this object, see HTTPResponse 
Objects.

I'd like to see the docs reorganized so that the '.. class' declaration in the 
docs is immediately followed by the class's methods, but that's a much bigger 
project.

--
nosy: +r.david.murray

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



[issue17552] socket.sendfile()

2014-04-21 Thread Josh Rosenberg

Josh Rosenberg added the comment:

For TransmitFile support, the Windows function to turn an integer file 
descriptor into a WinAPI file HANDLE should be _get_osfhandle: 
http://msdn.microsoft.com/en-us/library/ks2530z6.aspx

--
nosy: +josh.rosenberg

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



[issue21225] io.py: Improve docstrings for classes

2014-04-21 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
versions: +Python 3.4

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



[issue6305] islice doesn't accept large stop values

2014-04-21 Thread Alok Singhal

Alok Singhal added the comment:

This updated patch has support for starting in fast mode until the next count 
would result in overflow in Py_ssize_t.  The first patch started in slow mode 
as soon as any of 'start', 'stop', or 'step' was outside of the range.  With 
this patch, we start in fast mode if possible and then transition to slow mode 
when needed.

I also tested this patch for correctness for the following cases:

- starting in slow mode,
- transition from fast - slow,
- pickle/unpickle

I did this by temporarily changing the code twice:

- to always use fast mode, and
- pretending that overflow occurs at value 5 instead of PY_SSIZE_T_MAX.

--
Added file: http://bugs.python.org/file34996/islice_large_values-2.patch

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



[issue17552] socket.sendfile()

2014-04-21 Thread akira

akira added the comment:

Should socket.sendfile() always return number of bytes sent because file.tell() 
may be changed by something else that uses the same file descriptor?

What happens if the file grows?

Instead of returning `(was_os_sendfile_used, os_sendfile_error)`, you could 
specify `no_fallback=False` that could be set to `True` to assert that the 
fallback is not used (with `no_fallback=True` the `os_sendfile_error` is raised 
instead of using socket.send() as a fallback). 

If possible; always include number of bytes sent in any error that is raised.

--
nosy: +akira

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



[issue18617] TLS and Intermediate Certificates

2014-04-21 Thread Sam Vilain

Sam Vilain added the comment:

Perhaps the simplest thing here is to add a standard verify callback that 
catches verification errors, and returns the parsed server certificate as an 
attribute of the raised exception object.  From python, the exception can be 
caught and then the certificate data info used to fetch the intermediate 
certificate, and pass it into SSLContext.load_verify_locations().

This would force an extra client connection, but be less insane than trying to 
fetch and return the certificate from inside the SSL_CTX_set_verify() callback 
IMHO.

Does that sound workable?  Any hints for a would-be drive-by patcher?

--
nosy: +samv
versions: +Python 3.5

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Nick Coghlan

Nick Coghlan added the comment:

Folks, this is *really, really, simple*: one file per NEWS entry. How
we arrange them is just a detail. Don't go off trying to invent wild
exotic alternatives that spread state across multiple sources of truth
- significant historical info belongs in the version control system,
and NEWS entries are how we highlight this one is significant
(relative to other commits). A hg extension that prepopulates the
commit message from a NEWS entry included in the patch wouldn't be
difficult (especially since some of the Mercurial devs are likely to
join the new core workflow list).

--

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



[issue21325] Missing Generic EXIF library for images in the standard library

2014-04-21 Thread karl

New submission from karl:

There is a room for a consistent and good EXIF library for the Python Standard 
Library.

--
components: Library (Lib)
messages: 216978
nosy: karlcow
priority: normal
severity: normal
status: open
title: Missing Generic EXIF library for images in the standard library
type: enhancement

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



[issue17552] socket.sendfile()

2014-04-21 Thread Giampaolo Rodola'

Giampaolo Rodola' added the comment:

 Instead of returning [...] you could specify `no_fallback=False` that 
 could be set to `True` to assert that the fallback is not used
 [...] and return the number of bytes sent.

Good idea, thanks, that is much better indeed. Updated patch is in attachment.


 [...] file.tell() may be changed by something else that uses 
 the same file descriptor? What happens if the file grows?

I would say that is a use case we should explicitly not support as it probably 
implies you're doing something you're not supposed to. 


 If possible always include the number of bytes sent in any error that is 
 raised.

That's similar to my recent (rejected) proposal for socket.sendall():
https://mail.python.org/pipermail/python-ideas/2014-April/027689.html
IMO the patch as it stands is fine as you can determine the number of bytes 
which were sent either by using the function return value or file.tell() (in 
case of error).
Also, updating the file offset on exit makes the sendfile() implementation 
behave exactly like send().

--
Added file: http://bugs.python.org/file34997/socket-sendfile4.patch

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



[issue17552] socket.sendfile()

2014-04-21 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' g.rod...@gmail.com:


--
nosy: +josiah.carlson

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



[issue20901] test_sqlite fails with SQLite 3.8.4

2014-04-21 Thread koobs

koobs added the comment:

Updating versions to match branches fix was committed in

--
nosy: +koobs
versions: +Python 3.3

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



[issue21256] Sort keyword arguments in mock _format_call_signature

2014-04-21 Thread Kushal Das

Kushal Das added the comment:

New patch with test and news entry.

--
Added file: http://bugs.python.org/file34998/issue21256_v2.patch

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



[issue21228] Missing enumeration of HTTPResponse Objects methods of urllib.request.urlopen's http.client.HTTPResponse?

2014-04-21 Thread Martin Panter

Martin Panter added the comment:

I interpreted it more along the lines of “. . . returns a 
http.client.HTTPResponse object [with] the following [additional] methods.” 
Indeed, a HTTP urlopen() response I just tried does have info(), geturl() and 
getcode() methods, and I know the info() method is used in the real world.

Also, it would be good to document that the HTTP response’s “msg” attribute 
does not actually hold the header, despite the HTTPResponse documentation. 
Further, the return value of BaseHandler.default_open() is defined to be the 
same as urlopen(), but when a HTTP error occurs I have found the “msg” 
attribute is meant to be the HTTP status text phrase (e.g. “Not Found”).

Perhaps it would be good to add something like these two points wherever they 
belong:

* The “msg” attribute returned by urlopen() does not hold the HTTP header, 
despite the “HTTPResponse” documentation
* The “msg” attribute should be set to the HTTP status text phrase 
(HTTPResponse.reason)

--
nosy: +vadmium

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



[issue18967] Find a less conflict prone approach to Misc/NEWS

2014-04-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

My concern with a file for each entry is a possible slowdown of some 
operations, like TortoiseHg resyncing the diff between repository and working 
directory (it is not instantaneous even now). However, if there are multiple 
directories and if they are emptied periodically, so that there are never more 
than a few hundred in any directory, it might not be too bad. I agree that this 
idea is otherwise an improvement.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18967
___
___
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-04-21 Thread Martin Panter

Martin Panter added the comment:

I ran into a related issue with the gettarinfo() method. Would that fall under 
the scope of this bug, or should I raise a separate one?

 with tarfile.open(/dev/null, w) as tar:
... with open(b/bin/sh, rb) as file:
... tar.gettarinfo(fileobj=file)
... 
Traceback (most recent call last):
  File stdin, line 3, in module
  File /usr/lib/python3.4/tarfile.py, line 1768, in gettarinfo
arcname = arcname.replace(os.sep, /)
TypeError: expected bytes, bytearray or buffer compatible object

I realise that making TarInfo object with a byte string or integer as a file 
name is not a good idea. Perhaps the documentation should explicitly say that 
“fileobj.name” must be a real unencoded file name string unless “arcname” is 
also given. In my particular case I added arcname=, because my code generates 
the proper file name later on.

--

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



[issue21284] IDLE reformat tests fail in presence of non-default FormatParagraph setting

2014-04-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4ff2c0a637cf by Terry Jan Reedy in branch '2.7':
Issue 21284: Idle: make test_formatparagraph pass even when a user changes the
http://hg.python.org/cpython/rev/4ff2c0a637cf

New changeset fe067339af80 by Terry Jan Reedy in branch '3.4':
Issue 21284: Idle: make test_formatparagraph pass even when a user changes the
http://hg.python.org/cpython/rev/fe067339af80

--
nosy: +python-dev

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



[issue21284] IDLE reformat tests fail in presence of non-default FormatParagraph setting

2014-04-21 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


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

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



[issue21139] Idle: change default reformat width from 70 to 72

2014-04-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I applied my patch as part of #21284. When I did so, I added 'limit=70' so that 
the tests pass otherwise unchanged. The only thing left here is to change 
config-main.def.

--

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



[issue21138] mimetypes.MimeType UnicodeDecodeError

2014-04-21 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 374746c5dedc by Terry Jan Reedy in branch '2.7':
Issue #21138: Change default reformat paragraph width to PEP 8's 72.
http://hg.python.org/cpython/rev/374746c5dedc

New changeset dd24099c0cf6 by Terry Jan Reedy in branch '3.4':
Issue #21138: Change default reformat paragraph width to PEP 8's 72.
http://hg.python.org/cpython/rev/dd24099c0cf6

--
nosy: +python-dev

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



[issue21138] mimetypes.MimeType UnicodeDecodeError

2014-04-21 Thread Terry J. Reedy

Changes by Terry J. Reedy tjre...@udel.edu:


--
Removed message: http://bugs.python.org/msg216987

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



[issue21138] mimetypes.MimeType UnicodeDecodeError

2014-04-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The unlinked push message was for #21139.

--
nosy: +terry.reedy

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



[issue21139] Idle: change default reformat width from 70 to 72

2014-04-21 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I put 21138 in the commit message. The push messages are these.
New changeset 374746c5dedc by Terry Jan Reedy in branch '2.7':
Issue #21138: Change default reformat paragraph width to PEP 8's 72.
http://hg.python.org/cpython/rev/374746c5dedc

New changeset dd24099c0cf6 by Terry Jan Reedy in branch '3.4':
Issue #21138: Change default reformat paragraph width to PEP 8's 72.
http://hg.python.org/cpython/rev/dd24099c0cf6

--
resolution:  - fixed
stage: needs patch - resolved
status: open - closed

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