[issue13483] Use VirtualAlloc to allocate memory arenas

2013-05-22 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Ah ok. I guess tuples.py then indeed demonstrates a saving. I'll apply the 
patch.

--

___
Python tracker 

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



[issue18035] telnetlib incorrectly assumes that select.error has an errno attribute

2013-05-22 Thread Thayu R

Thayu R added the comment:

Just to add:
select.error was made an alias of OSError following PEP 3151 from 3.3 onwards. 
Up to 3.2, it was a pair containing the error code and the error string.

http://docs.python.org/3.3/library/select.html?highlight=select.error#select.error

--
nosy: +Thayu.R

___
Python tracker 

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



[issue18037] 2to3 passes through string literal which causes SyntaxError in 3.x

2013-05-22 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis :


--
nosy: +Arfrever

___
Python tracker 

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



[issue18037] 2to3 passes through string literal which causes SyntaxError in 3.x

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

However r'DOMAIN\username' is valid in 3.x (if this is not a regular expression 
in 3.3+).

It would be good to emit a warning in Python 2 with -3 option. Or perhaps even 
emit a warning about any non-known escape in non-raw strings.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

May be. But it needs more work for building. It is simpler just duplicate a 
code (the function is small enough) and add comments:

/* The code is duplicated as xx() in xxx.c.  Keep both functions synchronized. 
*/

--

___
Python tracker 

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



[issue18038] Unhelpful error message on invalid encoding specification

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is a patch.

--
components: +Interpreter Core, Unicode -Library (Lib)
keywords: +patch
nosy: +ezio.melotti, serhiy.storchaka
stage:  -> patch review
versions: +Python 3.3, Python 3.4
Added file: 
http://bugs.python.org/file30345/tokenizer_encoding_problem_msg.patch

___
Python tracker 

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



[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2013-05-22 Thread Eli Bendersky

Eli Bendersky added the comment:

Serhiy, would it make sense to share the code somewhere instead of duplicating 
it?

--

___
Python tracker 

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



[issue18041] mention issues with code churn in the devguide

2013-05-22 Thread Tshepang Lekhonkhobe

New submission from Tshepang Lekhonkhobe:

I've seen complaints about code churn a few times, example: 
http://bugs.python.org/issue16510#msg175956. Would be nice if this was 
documented in the devguide.

--
components: Devguide
messages: 189844
nosy: ezio.melotti, tshepang
priority: normal
severity: normal
status: open
title: mention issues with code churn in the devguide

___
Python tracker 

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



[issue18040] SIGINT catching regression on windows in 2.7

2013-05-22 Thread David Gilman

New submission from David Gilman:

I opened this StackOverflow bug with an example simplified testcase.  As you 
can see in the first comment a user added that this code worked under Python 
2.6 on Windows and no longer works on 2.7.

http://stackoverflow.com/questions/16686510/how-do-i-capture-sigint-in-python-on-windows?noredirect=1#comment24013681_16686510

Here's a patch that went into the 2.7 release that maybe is related? 
http://bugs.python.org/issue1677

--
messages: 189843
nosy: David.Gilman
priority: normal
severity: normal
status: open
title: SIGINT catching regression on windows in 2.7
versions: Python 2.7

___
Python tracker 

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



[issue6700] inspect.getsource() returns incorrect source lines

2013-05-22 Thread James Saryerwinnie

James Saryerwinnie added the comment:

I confirmed the issue in tip.  One of the issues with the original patch is
that it modifies the tokeneater method used by getblock which won't work
if the first token is any of the special cased tokens in the original patch
('@', 'def', 'class').  I've added additional tests that show where the
original patch fails.

An alternative approach is to check in getsourcelines whether or not we're
dealing with a traceback or frame object in the module scope, and if so,
return the lines of the entire module.  I've attached an updated patch
that implements this along with additional tests.

--
nosy: +James.Saryerwinnie
Added file: http://bugs.python.org/file30344/issue6700.patch

___
Python tracker 

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



[issue18039] dbm.open(..., flag="n") does not work and does not give a warning

2013-05-22 Thread Sashko Kopyl

New submission from Sashko Kopyl:

I use Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 
bit (Intel)] on win32.

dbm.open(..., flag="n") is supposed to "Always create a new, empty database, 
open for reading and writing".
In Windows case it does not. So I cannot empty a dbm database when I need it.

http://docs.python.org/3/library/dbm.html#module-dbm.dumb
Here it is written:
"The optional flag argument is currently ignored; the database is always opened 
for update, and will be created if it does not exist."

If it is ignored, there should be at least a warning. How am I supposed to now 
that this is a known bug?

--
components: Library (Lib)
messages: 189841
nosy: sonyachiko
priority: normal
severity: normal
status: open
title: dbm.open(..., flag="n") does not work and does not give a warning
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue18038] Unhelpful error message on invalid encoding specification

2013-05-22 Thread Max Cantor

New submission from Max Cantor:

When you specify a nonexistent encoding at the top of a file, like so for 
example:

# -*- coding: fakefakefoobar -*-

The following exception occurs:

SyntaxError: encoding problem: with BOM

This is very unhelpful, especially in cases where you might have made a typo in 
the encoding.

--
components: Library (Lib)
messages: 189840
nosy: Max.Cantor
priority: normal
severity: normal
status: open
title: Unhelpful error message on invalid encoding specification
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue17532] IDLE: Always include "Options" menu on MacOSX

2013-05-22 Thread Ned Deily

Ned Deily added the comment:

Thanks again for the patch.  Committed for release in 2.7.6, 3.3.3, and 3.4.0.

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue17532] IDLE: Always include "Options" menu on MacOSX

2013-05-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e134714e3b30 by Ned Deily in branch '2.7':
Issue #17532: Always include Options menu for IDLE on OS X.
http://hg.python.org/cpython/rev/e134714e3b30

New changeset 75c3e9a659bc by Ned Deily in branch '3.3':
Issue #17532: Always include Options menu for IDLE on OS X.
http://hg.python.org/cpython/rev/75c3e9a659bc

New changeset d0a093f40801 by Ned Deily in branch 'default':
Issue #17532: merge
http://hg.python.org/cpython/rev/d0a093f40801

--
nosy: +python-dev

___
Python tracker 

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



[issue18037] 2to3 passes through string literal which causes SyntaxError in 3.x

2013-05-22 Thread Vinay Sajip

New submission from Vinay Sajip:

"""
This string contains DOMAIN\username, which is talking about Windows
and is a valid string in Python 2.x but not in 3.x. However, 2to3 passes
this string through unchanged, and it causes a SyntaxError when
interpreted by Python 3.x, because it contains what looks like a
truncated Unicode escape.
"""

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 189837
nosy: benjamin.peterson, vinay.sajip
priority: normal
severity: normal
status: open
title: 2to3 passes through string literal which causes SyntaxError in 3.x
type: behavior
versions: Python 2.7

___
Python tracker 

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



[issue17649] Python/Python-ast.c: No such file or directory

2013-05-22 Thread Ned Deily

Ned Deily added the comment:

I believe there are two different issues here. One: since the python-dev switch 
to hg, Python source release tarballs no longer have had consistent file time 
stamps which result in unnecessary generation steps being run in a build. 
Python 2.7 and 3.3 now include the "make touch" target to manually fix the 
timestamps for generated files and, in Issue18008, changes were made to the 
release process scripts so that future source tarballs will be produced with 
consistent timestamps and these spurious generation steps should no longer run. 
 The second issue is making sure that, if you are building from a repo or 
possibly with separate, out-of-tree build directory, generated files are built 
correctly and are used as expected in the build.  There are a number of subtle 
points involved in getting this right for all cases; Issue15819 has been 
tracking these points.  I'm going to close this issue as a duplicate of it and 
suggest any further discussion take place there.

--
resolution: out of date -> duplicate
status: open -> closed
superseder:  -> Unable to build Python out-of-tree when source tree is  
readonly.

___
Python tracker 

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



[issue17818] aifc.Aifc_read/Aifc_write.getparams can return a namedtuple

2013-05-22 Thread R. David Murray

R. David Murray added the comment:

I've got it on my list, but I'm very busy for the next couple weeks.  If 
someone else gets to it first that's good too :)

--

___
Python tracker 

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



[issue17818] aifc.Aifc_read/Aifc_write.getparams can return a namedtuple

2013-05-22 Thread Claudiu.Popa

Claudiu.Popa added the comment:

Can anyone review the latest patch, please? Thanks.

--

___
Python tracker 

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-05-22 Thread Eli Bendersky

Eli Bendersky added the comment:

Agreed re 2.7; the problem is not important enough to warrant such a backport, 
due to the state of maintenance of 2.7 at this point.

--

___
Python tracker 

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




[issue17089] Expat parser parses strings only when XML encoding is UTF-8

2013-05-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions:  -Python 2.7

___
Python tracker 

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Due to the fact that ElementTree's documentation doesn't promise parsing 
Unicode string perhaps it shouldn't be backported to 2.7. At least I hadn't 
backported corresponded pyexpat changes (which affects pure Python ElementTree) 
to 2.7.

--
assignee:  -> serhiy.storchaka
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed
versions:  -Python 2.7

___
Python tracker 

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



[issue7727] xmlrpc library returns string which contain null ( \x00 )

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Indeed, 2.7 needs more work. Here is a patch for 2.7.

UnicodeError (which subclasses ValueError) can be raised implicitly here, that 
is why I think ValueError is a good exception.

I'll be very grateful to you for your help with a documentation.

--
Added file: 
http://bugs.python.org/file30343/xmlrpc_dump_invalid_string-2.7.patch

___
Python tracker 

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



[issue18035] telnetlib incorrectly assumes that select.error has an errno attribute

2013-05-22 Thread Gregory P. Smith

Gregory P. Smith added the comment:

As this is only on the select.poll code path, a workaround for code that isn't 
going to hit select.select file descriptor limits is to set their 
telnetlib.Telnet instance _has_poll attribute to False before using it.

my_telnet = telnetlib.Telnet(...)
my_telnet._has_poll = False

--

___
Python tracker 

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



[issue18036] "How do I create a .pyc file?" FAQ entry is out of date

2013-05-22 Thread R. David Murray

New submission from R. David Murray:

It doesn't talk about __pycache__.

--
messages: 189829
nosy: barry, r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: "How do I create a .pyc file?" FAQ entry is out of date
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue18035] telnetlib incorrectly assumes that select.error has an errno attribute

2013-05-22 Thread Gregory P. Smith

New submission from Gregory P. Smith:

In Python 2.7.3 through 2.7.5 the telnetlib select.poll based implementation 
assumes that select.error has an errno attribute when handling errors.  it does 
not.  select.error is not an EnvironmentError derived exception.

http://hg.python.org/cpython/file/85c04fdaa404/Lib/telnetlib.py#l317

i haven't check 3.x yet.

--
messages: 189828
nosy: gregory.p.smith
priority: normal
severity: normal
status: open
title: telnetlib incorrectly assumes that select.error has an errno attribute
versions: Python 2.7

___
Python tracker 

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



[issue18034] Last two entries in the programming FAQ are out of date (import related)

2013-05-22 Thread R. David Murray

New submission from R. David Murray:

The second to last talks about the __import__ quirk with out calling __import__ 
out as deprecated.  The last uses the imp module for reload.

--
assignee: docs@python
components: Documentation
messages: 189827
nosy: brett.cannon, docs@python, eric.snow, r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: Last two entries in the programming FAQ are out of date (import related)
type: behavior
versions: Python 3.3, Python 3.4

___
Python tracker 

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



[issue18031] The Python Tutorial says % string formatting will be removed

2013-05-22 Thread Eric V. Smith

Eric V. Smith added the comment:

I agree that we should not say that %-formatting will be removed from the 
language. Not until Python 5000, anyway.

--
nosy: +eric.smith

___
Python tracker 

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



[issue13483] Use VirtualAlloc to allocate memory arenas

2013-05-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I asked for benchmarks because I don't know anything about Windows virtual 
memory management, but if other people think this patch should go in then it's 
fine.

The main point of using VirtualAlloc/VirtualFree was, in my mind, to allow 
*releasing* memory in more cases than when relying on free() (assuming Windows 
uses some sbrk() equivalent). But perhaps Windows is already tuned to release 
memory on most free() calls.

--
stage:  -> commit review
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue13483] Use VirtualAlloc to allocate memory arenas

2013-05-22 Thread Charles-François Natali

Charles-François Natali added the comment:

I can't speak for Antoine, but I guess that the result of pybench
would be enough to make sure it doesn't introduce any regression
(which would be *really* suprising).
As for the memory savings, the benchmark you posted earlier is
conclusive enough IMO (especially since the it can be difficult to
come up with a scheme leading to heap fragmentation).

--

___
Python tracker 

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



[issue18033] Example for Profile Module shows incorrect method

2013-05-22 Thread Jough Dempsey

New submission from Jough Dempsey:

The example on this page:
http://docs.python.org/2/library/profile.html?highlight=pstats#profile.Profile

Shows:

import cProfile, pstats, io
pr = cProfile.Profile()
pr.enable()
... do something ...
pr.disable()
s = io.StringIO()
ps = pstats.Stats(pr, stream=s)
ps.print_results()

Where "ps.print_results()" should be "ps.print_stats()"

--
assignee: docs@python
components: Documentation
messages: 189823
nosy: docs@python, jough
priority: normal
severity: normal
status: open
title: Example for Profile Module shows incorrect method
type: enhancement
versions: Python 2.7

___
Python tracker 

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



[issue17844] Add link to alternatives for bytes-to-bytes codecs

2013-05-22 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue7727] xmlrpc library returns string which contain null ( \x00 )

2013-05-22 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Serhiy: The patch fixes the OP's concern, but not the extended concern about 
producing ill-formed XML (at least not for 2.7). If the string contains 
non-UTF-8 data, yet the XML declaration says UTF-8, it's still ill-formed, and 
not caught by your patch.

I wonder whether xmlrpclib.Error would be a better exception than ValueError 
(although ValueError is also plausible); either way, the case should be 
documented.

--

___
Python tracker 

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



[issue17844] Add link to alternatives for bytes-to-bytes codecs

2013-05-22 Thread Nick Coghlan

Nick Coghlan added the comment:

That sounds like a good idea. Yay for not needing those arcane footnotes, 
though :)

--

___
Python tracker 

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Oh, 2.7 still uses old doctests. It's a challenge to backport tests for this 
issue.

--
versions:  -Python 3.2

___
Python tracker 

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-05-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7781ccae7b9a by Serhiy Storchaka in branch '3.3':
Issue #16986: ElementTree now correctly parses a string input not only when
http://hg.python.org/cpython/rev/7781ccae7b9a

New changeset 659c1ce8ed2f by Serhiy Storchaka in branch 'default':
Issue #16986: ElementTree now correctly parses a string input not only when
http://hg.python.org/cpython/rev/659c1ce8ed2f

--
nosy: +python-dev

___
Python tracker 

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



[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2013-05-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies:  -ElementTree incorrectly parses strings with declared encoding 
not UTF-8

___
Python tracker 

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



[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is an updated patch. PyUnknownEncodingHandler() and 
expat_unknown_encoding_handler() are synchronized. Added tests.

--
Added file: 
http://bugs.python.org/file30342/expat_unknown_encoding_handler_2.patch

___
Python tracker 

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-05-22 Thread Eli Bendersky

Eli Bendersky added the comment:

LGTM

--

___
Python tracker 

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



[issue16986] ElementTree incorrectly parses strings with declared encoding not UTF-8

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Here is an updated patch.

--
Added file: http://bugs.python.org/file30341/etree_parse_str_2.patch

___
Python tracker 

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



[issue17272] request.full_url: unexpected results on assignment

2013-05-22 Thread Senthil Kumaran

Senthil Kumaran added the comment:

Here is patch with tests and docs. I see no changes to opener is required and 
the selector which is sent to HTTP request is the correct one. I have added 
tests for redirect url with #fragment too (For testing scenario reported in 
Issue 8280).

I shall close this issue once I commit this patch. In a separate report/ 
commit, get_full_url should be deprecated. Also, I like to see splittag being 
replaced with urlparse itself, so that our test and expectation with fragment 
will be consistent.

--
Added file: http://bugs.python.org/file30340/17272-3.patch

___
Python tracker 

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



[issue12641] Remove -mno-cygwin from distutils

2013-05-22 Thread Oscar Benjamin

Oscar Benjamin added the comment:

On 22 May 2013 13:40, Oscar Benjamin  wrote:
>
> However on further reflection I'm a little reluctant to force an error
> if I can't *prove* that the setup is broken.

After a little more reflection I realise that we could just do:

if self.gcc_version < '4' or is_cygwingcc():
# use -mno-cygwin

This way the cygwin/gcc-4 error is still emitted only if gcc emits it.
If the is_cygwingcc() function is conservative then there could be
cases where it mistakenly does not use -mno-cygwin but that would have
to be a broken cygwin/gcc-4 setup anyway.

--

___
Python tracker 

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



[issue12641] Remove -mno-cygwin from distutils

2013-05-22 Thread Oscar Benjamin

Oscar Benjamin added the comment:

On 22 May 2013 12:43, Martin v. Löwis  wrote:
> Am 21.05.13 23:14, schrieb Oscar Benjamin:
>> More generally I think that compiling non-cygwin extensions with
>> cygwin gcc should be altogether deprecated (for Python 3.4 at least).
>> It should be discouraged in the docs and unsupported in the future.
>
> I agree with that,

Excellent.

> although I find it sad that the Cygwin project
> apparently abandoned support for building Mingw binaries.

I don't understand their reasoning but given the scorn poured on to
-mno-cygwin from at least some people I trust that they had some good
reason :)

Also they have replaced it with something that they consider more
appropriate (the cross-compilers).

>> It can only work with -mno-cygwin
>
> This is factually incorrect. It also works with the i686-pc-mingw32-gcc
> executable, which (IIUC) is still available for Cygwin.

I should have been slightly clearer. It can only currently work in
distutils with -mno-cygwin. The executable you refer to is part of
cygwin gcc's cross-compiler toolchain. This is their recommended
replacement for -mno-cygwin (if not mingw) but is AFAICT unsupported
by distutils.

I think there's a case for saying that distutils should support these
but it should only be done with a new UnixCCompiler subclass and a new
--compiler entry point. It should also perhaps provide a way to
specify the --host since I think that facility is part of the purpose
of the new toolchain.

In any case cygwin cross-compiler support should not be conflated in
the codebase with distutils' mingw support and if it is to be added
that should be discussed in a separate issue. I personally don't think
I would use it and would not push for the support to be added.

Going back to the group C users: I think that it should be possible to
create an is_cygwingcc() function that would parse the output of 'gcc
--version'. Then Mingw32CCompiler.__init__ could do:

if is_cygwingcc() and self.gcc_version >= '4':
raise RuntimeError('No cygwin mode only works with gcc-3. Use
gcc-3 or mingw')

The is_cygwingcc() function can be conservative since false positives
or more of a problem than false negatives. I think this should address
your concern.

However on further reflection I'm a little reluctant to force an error
if I can't *prove* that the setup is broken. I'm no stranger to
monkey-patching distutils and it's possible that someone has already
monkey-patched it to make some bizarre setup just about work. I would
be a little peeved if my setup broke in a bugfix release simply
because someone else who didn't understand it decided that it wasn't
viable. (The same monkey-patching concerns apply to the other changes
but I think that fixing the non-monkey-patched setup for mingw trumps
in that case.) So perhaps the best place to deal with the
gcc-4/no-cygwin issue is in the distutils docs.

My updated proposal is (I'll write patches if this is acceptable):

Python 3.4:
Remove '-mno-cygwin'. This breaks the no-cygwin mode and fixes the
mingw mode. The distutils docs are updated with something like:
'''
Note: Previous Python versions supported another 'no-cygwin' mode that
could use cygwin gcc to build extensions without a dependency on
cygwin.dll. This is no longer supported.

New in Python 3.4: No-cygwin mode is no longer supported.
'''

Python 2.7, 3.2 and 3.3:
Only use '-mno-cygwin' if self.gcc_version < '4'. This should not
break any currently functioning setups (barring serious
monkey-patching). The distutils docs are updated with something like:
'''
Note: The no-cygwin mode only works with cygwin's gcc-3. For gcc-4 it
may produce .pyd files with dependencies on cygwin.dll that are not
fully redistributable. The use of no-cygwin mode is deprecated by
cygwin and support for it is removed in Python 3.4.
'''

If you would rather have the is_cygwingcc() check I'm happy to put
that in also if it gets this issue moving but I'm personally cautious
about it.

Thanks,
Oscar

--

___
Python tracker 

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



[issue17844] Add link to alternatives for bytes-to-bytes codecs

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Nick. It's mainly your patch.

Do you want to foreport your changes (a "Python Specific Encodings" subheading 
and followed paragraph) to 3.x?

--

___
Python tracker 

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



[issue17844] Add link to alternatives for bytes-to-bytes codecs

2013-05-22 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 85c04fdaa404 by Serhiy Storchaka in branch '2.7':
Issue #17844: Refactor a documentation of Python specific encodings.
http://hg.python.org/cpython/rev/85c04fdaa404

New changeset 039dc6dd2bc0 by Serhiy Storchaka in branch '3.3':
Issue #17844: Add links to encoders and decoders for bytes-to-bytes codecs.
http://hg.python.org/cpython/rev/039dc6dd2bc0

New changeset 9afdd88fe33a by Serhiy Storchaka in branch 'default':
Issue #17844: Add links to encoders and decoders for bytes-to-bytes codecs.
http://hg.python.org/cpython/rev/9afdd88fe33a

--
nosy: +python-dev

___
Python tracker 

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



[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2013-05-22 Thread Eli Bendersky

Eli Bendersky added the comment:

Looked at Serhiy's patch here too: LGTM with a unit test :)

--

___
Python tracker 

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



[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2013-05-22 Thread Eli Bendersky

Eli Bendersky added the comment:

> For unit tests we first should fix issue16986.

I did another round of code review on issue 16986 now.

--

___
Python tracker 

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



[issue7727] xmlrpc library returns string which contain null ( \x00 )

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The limitations is already documented:

"""However, it’s the caller’s responsibility to ensure that the string is free 
of characters that aren’t allowed in XML, such as the control characters with 
ASCII values between 0 and 31 (except, of course, tab, newline and carriage 
return); failing to do this will result in an XML-RPC request that isn’t 
well-formed XML. If you have to pass arbitrary bytes via XML-RPC, use the bytes 
class or the class:Binary wrapper class described below."""

Here is a patch which forbids creating ill-formed XML.

--
nosy: +serhiy.storchaka
stage: test needed -> patch review
versions: +Python 2.7, Python 3.3, Python 3.4 -Python 2.6
Added file: http://bugs.python.org/file30339/xmlrpc_dump_invalid_string.patch

___
Python tracker 

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



[issue7760] use_errno=True does not work

2013-05-22 Thread Matt Jones

Matt Jones added the comment:

Is this really a documentation issue?  Is it not generally understood that 
using absolute paths to libraries is a bad idea due to the amount of 
PATH/symlink spaghetti that the average file system contains?

--
nosy: +Matt.Jones

___
Python tracker 

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



[issue18032] set methods should specify whether they consume iterators "lazily"

2013-05-22 Thread Abafei

New submission from Abafei:

It says here 
(http://docs.python.org/2/library/stdtypes.html#set-types-set-frozenset) that 
some of the set methods take iterables as a parameter.

Usually, the expected behavior is for a iterator consumer to consume only as 
much data as it needs. For example, for the code `any(itertools.repeat(True))`, 
the code will complete speedily, in contrast to when all() is used instead of 
any(), in which case the code will go forever.

A least some of the set methods have semantics such that they can consume only 
some of the input; for example, "issubset" only needs to make sure that all of 
the items in the set are in the iterable, and once this is the case, it can 
return "True".

However in such a case, the methods will *still* go forever.

The docs should specify that this is the case, to disambiguate the semantics.

(Tested on Python 3.2.3 and 2.7.3).

--
assignee: docs@python
components: Documentation
messages: 189806
nosy: Abafei, docs@python
priority: normal
severity: normal
status: open
title: set methods should specify whether they consume iterators "lazily"
type: behavior
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue12641] Remove -mno-cygwin from distutils

2013-05-22 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Am 21.05.13 23:14, schrieb Oscar Benjamin:
> More generally I think that compiling non-cygwin extensions with
> cygwin gcc should be altogether deprecated (for Python 3.4 at least).
> It should be discouraged in the docs and unsupported in the future. 

I agree with that, although I find it sad that the Cygwin project
apparently abandoned support for building Mingw binaries.

> It can only work with -mno-cygwin 

This is factually incorrect. It also works with the i686-pc-mingw32-gcc
executable, which (IIUC) is still available for Cygwin.

--

___
Python tracker 

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



[issue18015] python 2.7.5 fails to unpickle namedtuple pickled by 2.7.3 or 2.7.4

2013-05-22 Thread Anselm Kruis

Anselm Kruis added the comment:

I created a small *.pth to monkey patch collections.py until 2.7.6 gets 
released. Maybe this is useful for someone else. Therefore I attach it here.

The pth file runs the following code during Python startup:

import collections
def _fix_issue_18015(collections):
try:
template = collections._class_template
except AttributeError:
# prior to 2.7.4 _class_template didn't exists
return
if not isinstance(template, basestring):
return  # strange
if "__dict__" in template or "__getstate__" in template:
return  # already patched
lines = template.splitlines()
indent = -1
for i,l in enumerate(lines):
if indent < 0:
indent = l.find('def _asdict')
continue
if l.startswith(' '*indent + 'def '):
lines.insert(i, ' '*indent + 'def __getstate__(self): pass')
lines.insert(i, ' '*indent + '__dict__ = _property(_asdict)')
break
collections._class_template = '''\n'''.join(lines)
_fix_issue_18015(collections)

--
Added file: http://bugs.python.org/file30338/fix_python_275_issue18015.pth

___
Python tracker 

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



[issue7727] xmlrpc library returns string which contain null ( \x00 )

2013-05-22 Thread Martin v . Löwis

Martin v. Löwis added the comment:

The original report really includes two parts:
a) when a string containing \0 is marshalled, ill-formed XML is produced
b) the expected behavior is that base64 is used

IMO: While a) is correct, b) is not. Antoine is correct that xmlrpclib.Binary 
should be used if you want to transmit binary data. Consequently, an Error 
should be reported if an attempt is made to produce ill-formed XML.

OTOH, ill-formed XML can also be produced when sending a byte string that does 
not match the encoding declaration. Because of that, I propose to close this by 
documentating the limitations, rather than changing the code.

--

___
Python tracker 

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



[issue18031] The Python Tutorial says % string formatting will be removed

2013-05-22 Thread Ned Batchelder

Changes by Ned Batchelder :


--
nosy: +nedbat

___
Python tracker 

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



[issue18031] The Python Tutorial says % string formatting will be removed

2013-05-22 Thread Carlos Nepomuceno

Carlos Nepomuceno added the comment:

According to what I have been told at python-l...@python.org str.__mod__() is 
not going to be deprecated and that seems to be a myth created by Python's own 
documentation.

I do remember to have read previously in another page that it would be 
deprecated but that seems to be already corrected. Today I just found it in the 
tutorial.

--

___
Python tracker 

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



[issue7727] xmlrpc library returns string which contain null ( \x00 )

2013-05-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I don't really understand the issue. If you want to pass binary data (rather 
than unicode text), you should use a Binary object as explained in the docs:
http://docs.python.org/2/library/xmlrpclib.html#binary-objects

--
nosy: +pitrou

___
Python tracker 

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



[issue17140] Provide a more obvious public ThreadPool API

2013-05-22 Thread Richard Oudkerk

Richard Oudkerk added the comment:

I understand that a thread pool (in the general sense) might be used to 
amortise the cost.  But I think you would probably have to write this from 
scratch rather than use the ThreadPool API.

The ThreadPool API does not really expose anything that the ThreadPoolExceutor 
API does not -- the differences are just a matter of taste.

--

___
Python tracker 

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



[issue17716] From ... import fails when parent package failed but child module succeeded, yet works in std import case

2013-05-22 Thread Nick Coghlan

Nick Coghlan added the comment:

import-sig is probably a better place to start

--

___
Python tracker 

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



[issue17140] Provide a more obvious public ThreadPool API

2013-05-22 Thread Nick Coghlan

Nick Coghlan added the comment:

Actors are just as vulnerable to the "new threads/processes are expensive" 
issue as anything else, and by using a dynamic pool appropriately you can 
amortise those costs across multiple instances.

The point is to expose a less opinionated threading model in a more readily 
accessible way. Executors and futures are *very* opinionated about the 
communication channels you're expected to use (the ones the executor provides), 
while pools are just a resource management tool.

--

___
Python tracker 

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



[issue17844] Add link to alternatives for bytes-to-bytes codecs

2013-05-22 Thread Nick Coghlan

Nick Coghlan added the comment:

Thanks Serhiy, that version looks great.

--

___
Python tracker 

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



[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

For unit tests we first should fix issue16986.

--

___
Python tracker 

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



[issue13612] xml.etree.ElementTree says unknown encoding of a regular encoding

2013-05-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
dependencies: +ElementTree incorrectly parses strings with declared encoding 
not UTF-8

___
Python tracker 

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



[issue18031] The Python Tutorial says % string formatting will be removed

2013-05-22 Thread Martin v . Löwis

Martin v. Löwis added the comment:

Can you please provide some context for this report?

On the abstract, I agree that there is an error in the tutorial: it is not 
decided whether the % formatting will be eventually removed, and I would also 
personally disagree with the recommendation to prefer .format.

--
nosy: +loewis

___
Python tracker 

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



[issue18030] IDLE shell crashes when reporting errors in Windows 7

2013-05-22 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

This is a duplicate of issue13582.

--
nosy: +serhiy.storchaka
resolution:  -> duplicate
stage:  -> committed/rejected
status: open -> closed
superseder:  -> IDLE and pythonw.exe stderr problem

___
Python tracker 

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



[issue18030] IDLE shell crashes when reporting errors in Windows 7

2013-05-22 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Windows
nosy: +brian.curtin, kbk, roger.serwy, terry.reedy, tim.golden

___
Python tracker 

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