[issue14133] improved PEP 409 implementation

2012-05-15 Thread Georg Brandl

Georg Brandl  added the comment:

I hope you're not disappointed when that PEP doesn't show up in the release 
notes :)

--

___
Python tracker 

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



[issue8996] Add a default role to allow writing bare `len` instead of :func:`len`

2012-05-15 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



[issue14804] Wrong defaults args notation in docs

2012-05-15 Thread Ezio Melotti

Ezio Melotti  added the comment:

Are you referring to #8350?

--

___
Python tracker 

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



[issue1294959] Problems with /usr/lib64 builds.

2012-05-15 Thread Marc-Andre Lemburg

Marc-Andre Lemburg  added the comment:

Éric Araujo wrote:
> 
> Éric Araujo  added the comment:
> 
> On Mar 29, 2011, at 10:12 PM, Matthias Klose wrote:
>> no, it looks for headers and libraries in more directories.  But really, this
>> whole testing for paths is wrong. Just use the compiler to search for headers
>> and libraries, no need to check these on your own.
> 
> Do all compilers provide this info, including Windows ones?  If so, that 
> would be a nice feature for distutils2.

This only works for a handful of system library paths, not the extra
ones that you may need to search for local installations of
libraries and which you have to inform the compiler about :-)

Many gcc installations, for example, don't include the /usr/local
or /opt/local dir trees in the search. On Windows, you have to
run the correct vc*.bat files to have the paths setup and optional
software rarely adds the correct paths to LIB and INCLUDE.

The compiler also won't help with the problem Sean originally
pointed to: building software on systems that can run both
32-bit and 64-bit and finding the right set of libs to
link at.

Another problem is finding the paths to the right version of a
library (both include files and corresponding libraries).

While it would be great to have a system tool take care of setting
things up correctly, I don't know of any such tool, so searching
paths and inspecting files using REs appears to be the only way
to build a general purpose detection scheme.

mxSetup.py (included in egenix-mx-base) uses such a scheme, distutils
has one too.

--

___
Python tracker 

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



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Chris Rebert

Chris Rebert  added the comment:

New revision per Éric's Rietveld feedback.

Sidenote: Is there any way to get notified of these reviews? I only saw it 
because I happened to click the "review" link on a lark.

--
Added file: http://bugs.python.org/file25594/json.rst.patch

___
Python tracker 

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



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Chris Rebert

Chris Rebert  added the comment:

The "import json"s were left for uniformity with the other code samples in the 
module's docs.


Also, here's what the pedantically-strict recipes might look like:

def _reject_inf_nan(string):
if string in {'-Infinity', 'Infinity', 'NaN'}:
raise ValueError("JSON does not allow infinite or NaN number values")

def _reject_dupe_keys(pairs):
obj = {}
for key, value in pairs:
if key in pairs:
raise ValueError("Name %s repeated in an object" % repr(key))
obj[key] = value
return obj

def strict_loads(string):
result = loads(string, parse_constant=_reject_inf_nan, 
object_pairs_hook=_reject_dupe_keys)
if not isinstance(result, (dict, list)):
raise ValueError("The top-level entity of the JSON text was not an 
object or an array")
return result


def strict_dumps(obj):
if not isinstance(obj, (dict, list)):
raise TypeError("The top-level object of a JSON text must be a dict or 
a list")
return dumps(obj, allow_nan=False)

--

___
Python tracker 

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



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Ezio Melotti

Ezio Melotti  added the comment:

Thanks for the patch, I left more comments on the review page.

IMHO it would be better to list the differences in a bullet list and expand 
later, rather than having a section for the parser and one for the generator.
AFAIU the differences are:
 * top-level scalar values are accepted/generated;
 * inf and nan are accepted/generated;
 * unicode strings (rather than utf-8) are produced/consumed;
 * duplicate keys are accepted, and the only the last one is used;

You can then add examples and explain "workarounds", either inline or after the 
list (I don't think it's necessary to add the snippets you posted in the last 
message though).


> Sidenote: Is there any way to get notified of these reviews?

In theory you should get notifications, in practice it doesn't always work.  We 
are still working on make it better.

--

___
Python tracker 

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



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Chris Rebert

Chris Rebert  added the comment:

Further copyediting.

--
Added file: http://bugs.python.org/file25595/json.rst.patch

___
Python tracker 

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



[issue14674] Link to & explain deviations from RFC 4627 in json module docs

2012-05-15 Thread Chris Rebert

Chris Rebert  added the comment:

Reflect broader scope

--
title: Add link to RFC 4627 from json documentation -> Link to & explain 
deviations from RFC 4627 in json module docs

___
Python tracker 

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



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Glenn Linderman

Glenn Linderman  added the comment:

There is no traceback.  Here is the text of the Syntax error.

d:\my\im\infiles>c:\python32\python.exe d:\my\py\t33a.py -h
  File "d:\my\py\t33a.py", line 2
SyntaxError: Non-UTF-8 code starting with '\xc3' in file d:\my\py\t33a.py on 
line 3, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for 
details

My understanding is Python 3 uses utf-8 as the default encoding for source 
files -- unless there is an encoding line; and I've set my emacs to save all 
.py files as utf-8-unix (meaning with no CR, if you aren't an emacs user).

I verified with a hex dump that the encoding in the file is UTF-8, but you are 
welcome to also, that is the file I uploaded.

So your testing would seem to indicate it is a platform specific bug.  Try 
running it on Windows, then.

Further, if it were the platform default encoding, adding a space wouldn't cure 
it... the encoding of the file would still be UTF-8, and the platform default 
encoding would still be the same whatever you think it might be (but I think it 
is UTF-8 for source text), so adding a space would not effect an encoding 
mismatch.

--

___
Python tracker 

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



[issue14805] Support display of both __cause__ and __context__

2012-05-15 Thread Patrick Westerhoff

Changes by Patrick Westerhoff :


--
nosy: +poke

___
Python tracker 

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



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> for key, value in pairs:
> if key in pairs:

"if key in obj:"?

--
title: Link to & explain deviations from RFC 4627 in json module docs -> Add 
link to RFC 4627 from json documentation

___
Python tracker 

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



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

IMHO, it would be sufficient to have a simple bullet list of differences
and notes or warnings in places where Python can generate non-standard
JSON (top-level scalars, inf and nan, non-utf8 encoded strings).

--

___
Python tracker 

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



[issue14803] Enhanced command line features for the runpy module

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> As Ned notes, to cover *implicit* creation of Python subprocesses an
> environment based solution would be needed to ensure the subprocesses
> adopt the desired settings.

So why aren't you proposing an environment-based solution instead? :)
To use the "-C" option, you have to modify all places which launch a
Python subprocess.

--
title: Add feature to allow code execution prior to __main__ invocation -> 
Enhanced command line features for the runpy module

___
Python tracker 

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



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Hynek Schlawack

Hynek Schlawack  added the comment:

You are right, file system encoding was platform dependent, not file encoding.

This space-after-parentheses trigger is odd; I'm adding the Windows guys to the 
ticket. Please tell us also your exact version of Windows.

--
components:  -Interpreter Core
nosy: +brian.curtin, tim.golden
type: compile error -> behavior

___
Python tracker 

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



[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-05-15 Thread Nick Coghlan

Nick Coghlan  added the comment:

Because I was thinking about a specific case where I *could* configure how the 
subprocesses were invoked (launching a test server for a web application). It 
took Ned's comment to remind me of the original use case (i.e. coverage 
statistics for a subprocesses created by an arbitrary application, *not* a 
custom test harness).

What this would allow is the elimination of a whole class of ad hoc feature 
requests - any process global configuration setting with a Python API would 
automatically also receive a command line API (via -C) and an environment API 
(via PYTHONRUNFIRST).

Some existing options (like -Xfaulthandler) may never have been added if -C was 
available.

That's why I changed the issue title (and am now updating the specific 
suggestion).

--
title: Enhanced command line features for the runpy module -> Add feature to 
allow code execution prior to __main__ invocation

___
Python tracker 

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



[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-05-15 Thread Nick Coghlan

Nick Coghlan  added the comment:

Actually, there's another use case for you:

export PYTHONRUNFIRST="import faulthandler; faulthandler.enable()"
application.py

All subprocesses launched by the application will now have faulthandler 
enabled, *without* modifying the application. Doing this in a shell session 
means that faulthandler will be enabled for all Python processes you launch.

Obviously, care would need to be taken to ensure PYTHONRUNFIRST is ignored for 
setuid scripts (and it would respect -E as with any other environment variable).

--

___
Python tracker 

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



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Antoine Pitrou

New submission from Antoine Pitrou :

I tried to build PC/VS9.0/pcbuild.sln using Visual Studio 2008, but it failed:

1>-- Build started: Project: make_buildinfo, Configuration: Release Win32 
--
2>-- Build started: Project: kill_python, Configuration: Debug x64 --
2>Compiling...
1>Compiling...
2>kill_python.c
1>make_buildinfo.c
2>c1 : fatal error C1083: Cannot open source file: '.\kill_python.c': No such 
file or directory
1>c1 : fatal error C1083: Cannot open source file: '.\make_buildinfo.c': No 
such file or directory
2>Build log was saved at 
"file://Z:\default\PC\VS9.0\x64-temp-Debug\kill_python\BuildLog.htm"
2>kill_python - 1 error(s), 0 warning(s)
1>Build log was saved at 
"file://Z:\default\PC\VS9.0\Win32-temp-Release\make_buildinfo\BuildLog.htm"
1>make_buildinfo - 1 error(s), 0 warning(s)
3>-- Build started: Project: make_versioninfo, Configuration: Debug Win32 
--
4>-- Build started: Project: w9xpopen, Configuration: Debug x64 --
3>Compiling...
4>Compiling...
3>make_versioninfo.c
4>w9xpopen.c
3>c1 : fatal error C1083: Cannot open source file: '..\PC\make_versioninfo.c': 
No such file or directory
4>c1 : fatal error C1083: Cannot open source file: '..\PC\w9xpopen.c': No such 
file or directory
3>Build log was saved at 
"file://Z:\default\PC\VS9.0\Win32-temp-Debug\make_versioninfo\BuildLog.htm"
3>make_versioninfo - 1 error(s), 0 warning(s)
4>Build log was saved at 
"file://Z:\default\PC\VS9.0\x64-temp-Debug\w9xpopen\BuildLog.htm"
4>w9xpopen - 1 error(s), 0 warning(s)
5>-- Build started: Project: pythoncore, Configuration: Debug x64 --
5>Compiling...
5>traceback.c
5>c1 : fatal error C1083: Cannot open source file: '..\Python\traceback.c': No 
such file or directory
5>thread.c
5>c1 : fatal error C1083: Cannot open source file: '..\Python\thread.c': No 
such file or directory
5>sysmodule.c
[etc.]

--
assignee: brian.curtin
components: Build
messages: 160704
nosy: brian.curtin, loewis, pitrou
priority: release blocker
severity: normal
status: open
title: Can't build under VS2008 anymore
type: compile error
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



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I tried to reproduce but failed to compile a Windows Python - see issue14813.

--
components: +Windows
nosy: +pitrou
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



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I can reproduce it on Linux. Minimal example:

$ ./python -c "open('longline.py', 'w').write('#' + repr('\u00A1' * 4096) + 
'\n')"
$ ./python longline.py
  File "longline.py", line 1
SyntaxError: Non-UTF-8 code starting with '\xc2' in file longline.py on line 1, 
but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details

--
nosy: +storchaka

___
Python tracker 

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



[issue14810] Bug in tarfile

2012-05-15 Thread Lars Gustäbel

Lars Gustäbel  added the comment:

This issue is related to issue13158 which deals with a GNU tar specific 
extension to the original tar format. In that issue a negative number in the 
uid/gid fields caused problems. In your case the problem is a negative mtime 
field.

Reading these particular number fields was fixed in Python 3.2. You might be 
able to read the archive in question with that version. You should definitely 
try that.

Besides that, I was unable to reproduce the error you report. I just did some 
tests and could not even open my test archive, because it was not recognized as 
a tar file. I didn't come as far as the os.utime() call.

--
nosy: +lars.gustaebel

___
Python tracker 

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



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

And for Python 2.7 too.

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



[issue14811] compile fails - UTF-8 character decoding

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Function decoding_fgets (Parser/tokenizer.c) reads line in buffer of fixed size 
8192 (line truncated to size 8191) and then fails because line is cut in the 
middle of a multibyte UTF-8 character.

--

___
Python tracker 

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



[issue14811] Syntax error on long UTF-8 lines

2012-05-15 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
title: compile fails - UTF-8 character decoding -> Syntax error on long UTF-8 
lines

___
Python tracker 

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



[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

For faulthandler and coverage would be more convenient option "-M" (run
module with __name__='__premain__' (or something of the sort) and
continue command line processing).

--

___
Python tracker 

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



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

Building with VS 2008 isn't officially supported anymore. If users want to 
continue to use VS 2008, they need to contribute patches. Preferably, the 
project files would be generated from the VS2010 project files, but for the 
moment, manually editing to make them work again might be fine as well.

Unassigning Brian for now - Brian, if you want to work on this, feel free to 
assign yourself again.

--
assignee: brian.curtin -> 
priority: release blocker -> normal

___
Python tracker 

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



[issue14810] Bug in tarfile

2012-05-15 Thread Hans Werner May

Hans Werner May  added the comment:

"Out of curiosity: where did you get a file that was last modified in 1956?"

No idea, this was a jpeg file, probably downloaded from internet. Btw, on Linux 
you can manipulate the creation date with the touch command, so it is possible 
to create a tarball with a member which has creation date 1956, but it is not 
possible to extract it with the extractall method.

--

___
Python tracker 

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



[issue14803] Add feature to allow code execution prior to __main__ invocation

2012-05-15 Thread Nick Coghlan

Nick Coghlan  added the comment:

No, that increases complexity and coupling, because it would only work for 
modules that were designed to work that way. Execution of a simple statement 
will work for any global state that can be modified from pure Python code 
(including invocation of more complex configuration settings from a custom 
Python module).

For a mature application, you wouldn't do it this way because you'd have other 
more polished mechanisms in place, but for debugging, experimentation and 
dealing with recalcitrant third party software, it could help deal with various 
problems without having to edit the code.

--

___
Python tracker 

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



[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-15 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

I've submitted the contributor agreement, though I've not yet heard anything 
back about it.

--

___
Python tracker 

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



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Building with VS 2008 isn't officially supported anymore. If users
> want to continue to use VS 2008, they need to contribute patches.

Well, VS 2010 is probably a multi-GB download and install. Besides,
having to juggle between two different VS versions will quickly become
confusing.

Speaking as a non-native Windows developer, there are enough hoops I
must jump through to do occasional testing under a Windows VM. So I
might simply stop caring.

--

___
Python tracker 

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



[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-15 Thread Thomas Kluyver

Thomas Kluyver  added the comment:

...And mere minutes after I said I hadn't heard anything, I've got the 
confirmation email. :-)

--

___
Python tracker 

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



[issue14809] Add HTTP status codes introduced by RFC 6585

2012-05-15 Thread Hynek Schlawack

Hynek Schlawack  added the comment:

EungYun,

After further research I've found two issue which you should fix before it can 
be checked in:

 - The multi-line strings are missing spaces at their line break (429 and 431).
 - The error codes are documented at 
http://hg.python.org/cpython/file/26b8ec8a7800/Doc/library/http.client.rst#l180 
, so you should add the new ones there.
 - You should mention the new RFC at Lib/http/server.py#l576 .

Would you like to update your patch?

--
stage: patch review -> needs patch

___
Python tracker 

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



[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> ...And mere minutes after I said I hadn't heard anything, I've got the 
> confirmation email. :-)

Congratulations!

--

___
Python tracker 

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



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-05-15 Thread Nick Coghlan

New submission from Nick Coghlan :

This issue tracks the incorporation of the ipaddress module into Python 3.3.

Tasks to be completed:
- add Lib/ipaddress.py from [1]
- add Lib/test_ipaddress.py from [1]
- create module reference docs from docstrings in [1]
- add Doc/library/ipaddress.py and link from index
- create howto guide from wiki page [2]
- add Doc/howto/ipaddress.rst and link from index

[1] https://code.google.com/p/ipaddress-py/source/browse/

[2] https://code.google.com/p/ipaddr-py/wiki/Using3144

--
components: Library (Lib)
messages: 160719
nosy: ncoghlan
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Implement PEP 3144 (the ipaddress module)
type: enhancement
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



[issue13952] mimetypes doesn't recognize .csv

2012-05-15 Thread Paul Cauchon

Changes by Paul Cauchon :


--
nosy: +Paul.Cauchon

___
Python tracker 

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



[issue14815] random_seed uses only 32-bits of hash on Win64

2012-05-15 Thread Martin v . Löwis

New submission from Martin v. Löwis :

random_seed has this code:

  long hash = PyObject_Hash(arg);

On Win64, Py_hash_t is a 64-bit type, yet long is a 32-bit type, so this 
truncates. I think the computation should be done in Py_ssize_t.

--
messages: 160720
nosy: loewis
priority: normal
severity: normal
status: open
title: random_seed uses only 32-bits of hash on Win64

___
Python tracker 

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



[issue14815] random_seed uses only 32-bits of hash on Win64

2012-05-15 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +rhettinger

___
Python tracker 

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



[issue14816] compilation failed on Ubuntu shared buildbot

2012-05-15 Thread Antoine Pitrou

New submission from Antoine Pitrou :

See http://www.python.org/dev/buildbot/all/builders/x86%20Ubuntu%20Shared%203.x

First failing build is 
http://www.python.org/dev/buildbot/all/builders/x86%20Ubuntu%20Shared%203.x/builds/5955

--
components: Build
messages: 160721
nosy: benjamin.peterson, db3l, pitrou
priority: release blocker
severity: normal
status: open
title: compilation failed on Ubuntu shared buildbot
type: crash
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



[issue14777] Tkinter clipboard_get() decodes characters incorrectly

2012-05-15 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

I'm ok with last patch version.

--

___
Python tracker 

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



[issue14804] Wrong defaults args notation in docs

2012-05-15 Thread Éric Araujo

Éric Araujo  added the comment:

Yes.  Close as duplicate?

--

___
Python tracker 

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



[issue14804] Wrong defaults args notation in docs

2012-05-15 Thread Petri Lehtinen

Petri Lehtinen  added the comment:

This issue is about documentation style of function signatures, not about 
missing keyword arguments in C functions.

--

___
Python tracker 

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



[issue14494] __future__.py and its documentation claim absolute imports became mandatory in 2.7, but they didn't

2012-05-15 Thread Petri Lehtinen

Changes by Petri Lehtinen :


--
nosy: +petri.lehtinen

___
Python tracker 

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



[issue14773] fwalk breaks on dangling symlinks

2012-05-15 Thread Hynek Schlawack

Hynek Schlawack  added the comment:

I just realized it doesn't really make sense because if a file disappears for 
real, we'll get another FileNotFoundException when checking whether it's a 
symlink and the continue is never reached.

So behold v3. :)

This time, I have tested it by injecting a

if name == 'tmp4':
import os
os.unlinkat(topfd, name)

right before the S_ISDIR in fwalk.

Some tests failed because said tmp4 was obviously missing – the old code threw 
FileNotFoundExceptions. After restoration the whole test suite passes in 
regression mode.

--
stage: commit review -> patch review
Added file: http://bugs.python.org/file25596/fwalk.diff

___
Python tracker 

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



[issue14807] Move tarfile.filemode() into stat module

2012-05-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 492e6c6a01bb by Giampaolo Rodola' in branch 'default':
#14807: move undocumented tarfile.filemode() to stat.filemode(). Add 
tarfile.filemode alias with deprecation warning.
http://hg.python.org/cpython/rev/492e6c6a01bb

--
nosy: +python-dev

___
Python tracker 

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



[issue14807] Move tarfile.filemode() into stat module

2012-05-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


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



[issue14800] stat.py constant comments + docstrings

2012-05-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
assignee:  -> giampaolo.rodola
keywords: +easy -patch
stage:  -> committed/rejected
status: open -> closed
type:  -> enhancement

___
Python tracker 

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



[issue14807] Move tarfile.filemode() into stat module

2012-05-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
assignee:  -> giampaolo.rodola

___
Python tracker 

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



[issue11959] smtpd cannot be used without affecting global state

2012-05-15 Thread Vinay Sajip

Vinay Sajip  added the comment:

> If asyncore and asynchat are (mostly?) supporting an alternate
> socket map, why is it necessary to copy create_socket?
> Shouldn't we be fixing create_socket in asyncore instead?

Well, I don't see how this can be done along with keeping existing behaviour, 
since if you currently pass a map to the dispatcher constructor, it's not 
passed to set_socket; fixing it in asyncore would mean changing this fact, and 
so in theory could break existing code.

--

___
Python tracker 

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



[issue11959] smtpd cannot be used without affecting global state

2012-05-15 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Changing it in asyncore is fine.

--

___
Python tracker 

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



[issue14804] Wrong defaults args notation in docs

2012-05-15 Thread Ezio Melotti

Ezio Melotti  added the comment:

Indeed.

--

___
Python tracker 

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



[issue14773] fwalk breaks on dangling symlinks

2012-05-15 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage: patch review -> commit review

___
Python tracker 

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



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-05-15 Thread Tshepang Lekhonkhobe

Changes by Tshepang Lekhonkhobe :


--
nosy: +tshepang

___
Python tracker 

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



[issue14773] fwalk breaks on dangling symlinks

2012-05-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset cbe7560d4443 by Hynek Schlawack in branch 'default':
#14773: Fix os.fwalk() failing on dangling symlinks
http://hg.python.org/cpython/rev/cbe7560d4443

--
nosy: +python-dev

___
Python tracker 

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



[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

2012-05-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 3e10d0148f79 by Senthil Kumaran in branch '2.7':
Issue #12541: Be lenient with quotes around Realm field with HTTP Basic 
Authentation in urllib2.
http://hg.python.org/cpython/rev/3e10d0148f79

New changeset bb94fec5c5ab by Senthil Kumaran in branch '3.2':
Issue #12541: Be lenient with quotes around Realm field of HTTP Basic 
Authentation in urllib2.
http://hg.python.org/cpython/rev/bb94fec5c5ab

New changeset bf20564296aa by Senthil Kumaran in branch 'default':
merge from 3.2 - Issue #12541: Be lenient with quotes around Realm field of 
HTTP Basic Authentation in urllib2.
http://hg.python.org/cpython/rev/bf20564296aa

--
nosy: +python-dev

___
Python tracker 

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



[issue14809] Add HTTP status codes introduced by RFC 6585

2012-05-15 Thread EungJun Yi

Changes by EungJun Yi :


Added file: http://bugs.python.org/file25597/rfc6585.patch

___
Python tracker 

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



[issue14809] Add HTTP status codes introduced by RFC 6585

2012-05-15 Thread EungJun Yi

EungJun Yi  added the comment:

Hynek, I have fixed them and upload the patch, rfc6585-rev2.patch.

--

___
Python tracker 

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



[issue11959] smtpd cannot be used without affecting global state

2012-05-15 Thread R. David Murray

R. David Murray  added the comment:

But it is create_socket you want to change.  So if we add a map argument to 
that and only pass it to socket if it is non-None, wouldn't that maintain 
backward compatibility with current asyncore behavior?  Neither asyncore nor 
asynchat calls create_socket, as far as I can see.

--

___
Python tracker 

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



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Well, VS 2010 is probably a multi-GB download and install. Besides,
> having to juggle between two different VS versions will quickly become
> confusing.

Sure. However, it is not feasible to keep the build systems for many
VS versions up-to-date, just because contributors are shy of installing
the current version. Tracking two build systems (autoconf and VS) is
already difficult enough.

> Speaking as a non-native Windows developer, there are enough hoops I
> must jump through to do occasional testing under a Windows VM. So I
> might simply stop caring.

This is free software. If you don't want to care, you don't have to.
It's the same as switching from Subversion to Mercurial: we probably
lost some contributors who never bothered to learn Mercurial. That
didn't stop us from switching. I expect that most occasional contributors
will find it easier to use VS 2010 than VS 2008.

--

___
Python tracker 

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



[issue14072] urlparse on tel: URI-s misses the scheme in some cases

2012-05-15 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

Hi Ezio,

The patch is fine and the check is correct. I was thinking if by removing int() 
based verification are we missing out anything on port number check. But looks 
like we wont as the int() previously is done to find the proper scheme and url 
part for the applicable cases.

In addition to changes in the patch, I think, it would helpful to add 'tel' to 
uses_netloc in the classification at the top of the module.

Thanks!

--
assignee: orsenthil -> ezio.melotti

___
Python tracker 

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



[issue14809] Add HTTP status codes introduced by RFC 6585

2012-05-15 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
nosy: +orsenthil

___
Python tracker 

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



[issue14133] improved PEP 409 implementation

2012-05-15 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2012/5/15 Georg Brandl :
>
> Georg Brandl  added the comment:
>
> I hope you're not disappointed when that PEP doesn't show up in the release 
> notes :)

It gives me more peace of mind than any release note ever could. :)

--

___
Python tracker 

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



[issue14072] urlparse on tel: URI-s misses the scheme in some cases

2012-05-15 Thread Éric Araujo

Éric Araujo  added the comment:

> it would helpful to add 'tel' to uses_netloc

How so?  The tel scheme does not use a netloc.

--

___
Python tracker 

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



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-05-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> This is free software. If you don't want to care, you don't have to.

Of course. I'm just pointing this out in relation with the fact that we
don't have many Windows-based developers :-)

> I expect that most occasional contributors
> will find it easier to use VS 2010 than VS 2008.

Are there any features which make VS 2010 easier to use for us?

--

___
Python tracker 

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



[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

2012-05-15 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

this issue is taken care. Both in accepting unquoted Realm for basic auth 
leniently and then raising a UserWarning when encountering this case.

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



[issue12541] Accepting Badly formed headers in urllib HTTPBasicAuth

2012-05-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset b82178b07e0f by Senthil Kumaran in branch '2.7':
Issue12541 - Add UserWarning for unquoted realms
http://hg.python.org/cpython/rev/b82178b07e0f

New changeset b5b38bda9fc4 by Senthil Kumaran in branch '3.2':
Issue12541 - Add UserWarning for unquoted realms
http://hg.python.org/cpython/rev/b5b38bda9fc4

New changeset 08fa1a47fa97 by Senthil Kumaran in branch 'default':
Issue12541 - Add UserWarning for unquoted realms
http://hg.python.org/cpython/rev/08fa1a47fa97

--

___
Python tracker 

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



[issue11959] smtpd cannot be used without affecting global state

2012-05-15 Thread Vinay Sajip

Vinay Sajip  added the comment:

> So if we add a map argument to that and only pass it to socket if it
> is non-None, wouldn't that maintain backward compatibility with
> current asyncore behavior?

Sorry I was being a bit dense ... it's been a while since I looked at this. I 
think you are right that the base create_socket could be changed in this way. 
I'll work up a patch in my sandbox branch (for easier Rietveld integration).

--

___
Python tracker 

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



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Stefan Krah

Changes by Stefan Krah :


--
nosy: +skrah

___
Python tracker 

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



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Brian Curtin

Brian Curtin  added the comment:

> Are there any features which make VS 2010 easier to use for us?

I don't do much with the IDE besides the basics of writing the code and 
building it, so I can't really say if it makes anything easier on us. I think 
the change is just going to be doing the same thing on a newer version.

The change is more driven from keeping up with what everyone else is using. I 
did a VS2010 port at my old job over a year ago because we needed it, and CCP 
games (Kristjan) moved to VS2010 even before that.

I will look through and see what it may provide that we could take advantage 
of, but I don't remember seeing much that we could use. C# gets all of the 
goodies, then C++ is in second place, and all we in C world really get is a new 
CRT version. However, if we didn't change to 2010 now, due to our release 
schedule we'd be stuck with VS2008 until at least 2014, which would be at least 
two VS versions behind by then.

--

___
Python tracker 

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



[issue13968] Support recursive globs

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

I'm looking at the tests and I don't understand why '**/bcd/*' should match 
'a/bcd/efg/ha'. Am I missing something?

--

___
Python tracker 

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



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> Are there any features which make VS 2010 easier to use for us?

Not for us, but for our users. Users request to build Python with VS 2010,
because that's all they have. It's already a major pain for Python Windows
developers to discover that they can't build Python 2.7 extensions with their
VS installation. So we absolutely have to use the latest VS release for each
Python release - we will be using that for at least two years, at which
point VS 2008 may not be available anymore from MS.

VS 2008 will end its mainstream support on April 9, 2013; the Extended Support
will be available until April 10, 2018. I'm not entirely sure about  
the policy,
but I think commercial availability ends with the mainstream support (i.e. in
a year from now). I'm also not sure whether this means that they will take
VS Express 2008 off the net (which also expires its mainstream support  
in 2013).

FWIW, VS 2010 Pro has mainstream support until July 14, 2015, and extended
support until September 8, 2020 (at this point; they may extend it depending
on when the successor version becomes available).

--

___
Python tracker 

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



[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

2012-05-15 Thread Markus

Markus  added the comment:

Hi,

the C implementation of ElementTree do not support namespaces for find/all/... .

To me this is a serious regression, as I rely on ElementTree namespace support, 
and 3.3 would break it with this change.
Breaking namespace support is a fundamental problem.

Please reconsider this therefore.

Code to reproduced attached - works fine with python 3.2.

As the C implementation of ElementTree and Element lack the namespace keyword 
for findall (and *all* the other methods), 
where namespaces are very important when dealing with xml, 
and it is not possible to prevent using the v implementation of ElementTree 
without changing the python install, 
I propose to revert this change.

Until the C implementation can do namespaces as well.

--
nosy: +cmn
type: performance -> behavior
Added file: 
http://bugs.python.org/file25598/findall_takes_no_keywords_anymore.py

___
Python tracker 

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



[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

2012-05-15 Thread Markus

Changes by Markus :


Removed file: 
http://bugs.python.org/file25598/findall_takes_no_keywords_anymore.py

___
Python tracker 

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



[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

2012-05-15 Thread Markus

Markus  added the comment:

The file was bad, sorry.
re-attached

--
Added file: 
http://bugs.python.org/file25599/findall_takes_no_keywords_anymore.py

___
Python tracker 

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



[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

2012-05-15 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

Markus (cmn): Please file a separate issue, which will be a release blocker for 
3.3 release. (It's not the only regression.)

--

___
Python tracker 

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



[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

2012-05-15 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis  added the comment:

Temporary very ugly workaround (before importing xml.etree.ElementTree) is:

import sys
sys.modules["_elementtree"] = None

--

___
Python tracker 

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



[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

2012-05-15 Thread Ezio Melotti

Ezio Melotti  added the comment:

It seems to me that namespaces are actually supported, but they are accepted 
only as positional args and not keyword args, so this should be easy to fix.

--

___
Python tracker 

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



[issue14674] Add link to RFC 4627 from json documentation

2012-05-15 Thread Chris Rebert

Chris Rebert  added the comment:

>> for key, value in pairs:
>> if key in pairs:
> 
> "if key in obj:"?

Yes, obviously. :-)  It wrote those very late at night.

@Ezio: These were per Éric's feedback but would be for a separate bug/patch.

--

___
Python tracker 

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



[issue14817] pkgutil.extend_path has no tests

2012-05-15 Thread Eric V. Smith

New submission from Eric V. Smith :

Subject says it all.

There are also no tests of .pkg files.

--
components: Tests
keywords: easy
messages: 160751
nosy: eric.smith
priority: normal
severity: normal
status: open
title: pkgutil.extend_path has no tests

___
Python tracker 

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



[issue11959] smtpd cannot be used without affecting global state

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I initially came across this because I got some warnings from
> regrtest.py about changed state, when I was trying to implement a
> TestSMTPServer class (derived from smtpd.SMTPServer) to test the
> SMTPHandler in logging.

If you get a warning, it means your tests lack proper cleanup, so you should 
fix that instead of trying to make the warning disappear by circumventing 
regrtest's detection mechanism.

--
nosy: +pitrou

___
Python tracker 

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



[issue14818] C implementation of ElementTree causes regressions

2012-05-15 Thread Markus

New submission from Markus :

The C implementation of ElementTree which is the default by python3.3 [1] does 
not accept the namespaces keyword for Element/ElementTree.find(all|iter|...) 
and maybe others.


[1] http://bugs.python.org/issue13988

--
components: Library (Lib)
messages: 160753
nosy: cmn
priority: normal
severity: normal
status: open
title: C implementation of ElementTree causes regressions
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



[issue13988] Expose the C implementation of ElementTree by default when importing ElementTree

2012-05-15 Thread Markus

Markus  added the comment:

As advised I opened a new bug on this:
http://bugs.python.org/issue14818

--

___
Python tracker 

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



[issue1635217] Add example of distutils setup() with "requires" argument

2012-05-15 Thread anatoly techtonik

anatoly techtonik  added the comment:

It doesn't seem that requires parameter is honored by pip. Should we document 
install_requires instead?

--

___
Python tracker 

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



[issue14818] C implementation of ElementTree causes regressions

2012-05-15 Thread Ezio Melotti

Ezio Melotti  added the comment:

As I wrote on the other issue:

> It seems to me that namespaces are actually supported, but they are
> accepted only as positional args and not keyword args, so this should 
> be easy to fix.

I can prepare a patch unless someone else is faster than me.

--
nosy: +eli.bendersky, ezio.melotti
priority: normal -> release blocker
stage:  -> needs patch

___
Python tracker 

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



[issue14807] Move tarfile.filemode() into stat module

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Buildbot failures:
http://www.python.org/dev/buildbot/all/builders/AMD64%20FreeBSD%209.0%203.x/builds/2540
http://www.python.org/dev/buildbot/all/builders/x86%20Tiger%203.x/builds/4572

--
status: closed -> open

___
Python tracker 

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



[issue14584] Add gzip support to xmlrpc.server

2012-05-15 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

The server encodes the response if the length of the response exceeds 
self.encode_threshold, 1400 (presumably there's no point in compression if the 
data fits in the MTU anyway).

--
nosy: +rosslagerwall

___
Python tracker 

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



[issue14807] Move tarfile.filemode() into stat module

2012-05-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 539fbd6e58f6 by Giampaolo Rodola' in branch 'default':
#14807: fix bb failure due to symlink test relying on hard-coded permissions
http://hg.python.org/cpython/rev/539fbd6e58f6

--

___
Python tracker 

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



[issue14807] Move tarfile.filemode() into stat module

2012-05-15 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

Thanks. It should now be fixed.

--
status: open -> closed

___
Python tracker 

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



[issue13156] _PyGILState_Reinit assumes auto thread state will always exist which is not true.

2012-05-15 Thread Daniel Franke

Daniel Franke  added the comment:

Just FYI, I've lately been trying to track down a different threading-related 
bug, and I think the fix for this one also fixed that one by accident.

Leave the following program running for a while under python-2.7.2:

---snip---
import subprocess
import threading
import random

class Forkfuzz(threading.Thread):
def run(self):
while random.randint(0,100) > threading.active_count():
Forkfuzz().start()

p = subprocess.Popen(['/bin/sleep', '1'])
p.communicate()

if __name__ == "__main__":
while True:
Forkfuzz().run()
---snip---

Eventually, you'll see a bunch of python process that are deadlocked in the 
following state:

#0  sem_wait () at ../nptl/sysdeps/unix/sysv/linux/x86_64/sem_wait.S:86
#1  0x004e02ad in PyThread_acquire_lock (lock=, 
waitflag=) at Python/thread_pthread.h:321
#2  0x004e0447 in find_key (key=1, value=0x0) at Python/thread.c:268
#3  0x004e053b in PyThread_get_key_value (key=38356064) at 
Python/thread.c:360
#4  0x004cb2f8 in PyGILState_GetThisThreadState () at 
Python/pystate.c:598
#5  _PyGILState_Reinit () at Python/pystate.c:547
#6  0x004e43f9 in PyOS_AfterFork () at ./Modules/signalmodule.c:979
...

The problem happens when one thread forks while another thread holds a lock on 
the TLS mutex. The child process then tries to acquire this mutex, and can 
never do so because the thread that holds it only exists in the parent.

When the same program is run under python-2.7.3, the problem goes away.

--
nosy: +dfranke

___
Python tracker 

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



[issue14818] C implementation of ElementTree causes regressions

2012-05-15 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



[issue14814] Implement PEP 3144 (the ipaddress module)

2012-05-15 Thread Alan Kennedy

Changes by Alan Kennedy :


--
nosy: +amak

___
Python tracker 

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



[issue14819] Add `assertIsSubclass` and `assertNotIsSubclass` to `unittest.TestCase`

2012-05-15 Thread Patrick Smith

New submission from Patrick Smith :

The attached patch adds two helper methods to `unittest.TestCase`: 
`assertIsSubclass` and `assertIsNotSubclass`. These methods are similar to the 
`assertIsInstance` and `assertIsNotInstance` methods that are already part of 
`unittest.TestCase`. They allow one to test if a class is a subclass of another 
class using the `issubclass` builtin.

These methods can be used like:
self.assertIsSubclass(cls, parent_cls)

These new methods provide a nicer error message and more consistent interface 
over the alternatives:
self.assertTrue(issubclass(cls, parent_cls))
assert issubclass(cls, parent_cls)

--
components: Library (Lib)
files: assertissubclass.patch
keywords: patch
messages: 160762
nosy: patricksmith
priority: normal
severity: normal
status: open
title: Add `assertIsSubclass` and `assertNotIsSubclass` to `unittest.TestCase`
type: enhancement
Added file: http://bugs.python.org/file25600/assertissubclass.patch

___
Python tracker 

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



[issue11959] smtpd cannot be used without affecting global state

2012-05-15 Thread Vinay Sajip

Vinay Sajip  added the comment:

> If you get a warning, it means your tests lack proper cleanup, so you
> should fix that instead of trying to make the warning disappear by
> circumventing regrtest's detection mechanism.

What makes you say I was trying to circumvent regrtest's detection mechanism? I 
wasn't. Isn't it the case that tests shouldn't affect global state? Since 
regrtest told me that global state was being changed by the smtpd module used 
by the test, I tried to find a way of avoiding changing global state in my test 
- but because of the problem I mention, I couldn't see a way of using smtpd 
without affecting global state. This is partly because of an underlying wart in 
asyncore, which this issue is trying to address.

Do you have a proposal about how to solve this - is there something you think 
I've missed? Do you have specific concerns about the approach being discussed?

--

___
Python tracker 

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



[issue14819] Add `assertIsSubclass` and `assertNotIsSubclass` to `unittest.TestCase`

2012-05-15 Thread Ezio Melotti

Ezio Melotti  added the comment:

Hi, this has been discussed already, and we took the decision to leave these 
out, since checking for subclasses is not as common as checking the type.
If needed, this could still be implemented by the user, and possibly they could 
be added as recipes to the unittest doc.
Michael what do you think?

--
nosy: +ezio.melotti, michael.foord
resolution:  -> rejected
stage:  -> committed/rejected
status: open -> pending
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



[issue11959] smtpd cannot be used without affecting global state

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I tried to find a way of avoiding changing global state in my test -
> but because of the problem I mention, I couldn't see a way of using
> smtpd without affecting global state.

Well, other tests manage it even without using a private socket map.
Leaving dangling sockets in the socket map could mean your code forgets
to close them, for example. So it's better to fix the code or the tests,
rather than try to defeat the detection mechanism.

--

___
Python tracker 

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



[issue14624] Faster utf-16 decoder

2012-05-15 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Here are two new patch. Checking for characters out-of-range moved,
making the code simpler. Theoretically it is a bit slow down decoding of
short UCS1 strings (up to 1 and 3 chars on 32- and 64-bit), but
practically there is no difference. The second patch is different from
the first patch that masks are not calculated and specified explicitly.
I am not sure that it improves readability. The commiter has the choice.

--
Added file: http://bugs.python.org/file25601/decode_utf16_5.patch
Added file: http://bugs.python.org/file25602/decode_utf16_6.patch

___
Python tracker 

___diff -r 492e6c6a01bb Objects/stringlib/codecs.h
--- a/Objects/stringlib/codecs.hTue May 15 15:30:25 2012 +0200
+++ b/Objects/stringlib/codecs.hWed May 16 00:26:02 2012 +0300
@@ -215,7 +215,6 @@
 goto Return;
 }
 
-#undef LONG_PTR_MASK
 #undef ASCII_CHAR_MASK
 
 
@@ -415,4 +414,152 @@
 #undef MAX_SHORT_UNICHARS
 }
 
+/* The pattern for constructing UCS2-repeated masks. */
+#if SIZEOF_LONG == 8
+# define UCS2_REPEAT_MASK 0x0001000100010001ul
+#elif SIZEOF_LONG == 4
+# define UCS2_REPEAT_MASK 0x00010001ul
+#else
+# error C 'long' size should be either 4 or 8!
+#endif
+
+/* The mask for fast checking. */
+#if STRINGLIB_SIZEOF_CHAR == 1
+/* The mask for fast checking of whether a C 'long' contains a
+   non-ASCII or non-Latin1 UTF16-encoded characters. */
+# define FAST_CHAR_MASK (UCS2_REPEAT_MASK * (0xu & 
~STRINGLIB_MAX_CHAR))
+#else
+/* The mask for fast checking of whether a C 'long' may contain
+   UTF16-encoded surrogate characters. This is an efficient heuristic,
+   assuming that non-surrogate characters with a code point >= 0x8000 are
+   rare in most input.
+*/
+# define FAST_CHAR_MASK (UCS2_REPEAT_MASK * 0x8000u)
+#endif
+/* The mask for fast byte-swapping. */
+#define STRIPPED_MASK   (UCS2_REPEAT_MASK * 0x00FFu)
+/* Swap bytes. */
+#define SWAB(value) value) >> 8) & STRIPPED_MASK) | \
+ (((value) & STRIPPED_MASK) << 8))
+
+Py_LOCAL_INLINE(Py_UCS4)
+STRINGLIB(utf16_decode)(const unsigned char **inptr, const unsigned char *e,
+STRINGLIB_CHAR *dest, Py_ssize_t *outpos,
+int native_ordering)
+{
+Py_UCS4 ch;
+const unsigned char *aligned_end =
+(const unsigned char *) ((size_t) e & ~LONG_PTR_MASK);
+const unsigned char *q = *inptr;
+STRINGLIB_CHAR *p = dest + *outpos;
+/* Offsets from q for retrieving byte pairs in the right order. */
+#ifdef BYTEORDER_IS_LITTLE_ENDIAN
+int ihi = !!native_ordering, ilo = !native_ordering;
+#else
+int ihi = !native_ordering, ilo = !!native_ordering;
+#endif
+--e;
+
+while (q < e) {
+Py_UCS4 ch2;
+/* First check for possible aligned read of a C 'long'. Unaligned
+   reads are more expensive, better to defer to another iteration. */
+if (!((size_t) q & LONG_PTR_MASK)) {
+/* Fast path for runs of in-range non-surrogate chars. */
+register const unsigned char *_q = q;
+while (_q < aligned_end) {
+unsigned long block = * (unsigned long *) _q;
+if (native_ordering) {
+/* Can use buffer directly */
+if (block & FAST_CHAR_MASK)
+break;
+}
+else {
+/* Need to byte-swap */
+if (block & SWAB(FAST_CHAR_MASK))
+break;
+#if STRINGLIB_SIZEOF_CHAR == 1
+block >>= 8;
+#else
+block = SWAB(block);
+#endif
+}
+#ifdef BYTEORDER_IS_LITTLE_ENDIAN
+# if SIZEOF_LONG == 4
+p[0] = (STRINGLIB_CHAR)(block & 0xu);
+p[1] = (STRINGLIB_CHAR)(block >> 16);
+# elif SIZEOF_LONG == 8
+p[0] = (STRINGLIB_CHAR)(block & 0xu);
+p[1] = (STRINGLIB_CHAR)((block >> 16) & 0xu);
+p[2] = (STRINGLIB_CHAR)((block >> 32) & 0xu);
+p[3] = (STRINGLIB_CHAR)(block >> 48);
+# endif
+#else
+# if SIZEOF_LONG == 4
+p[0] = (STRINGLIB_CHAR)(block >> 16);
+p[1] = (STRINGLIB_CHAR)(block & 0xu);
+# elif SIZEOF_LONG == 8
+p[0] = (STRINGLIB_CHAR)(block >> 48);
+p[1] = (STRINGLIB_CHAR)((block >> 32) & 0xu);
+p[2] = (STRINGLIB_CHAR)((block >> 16) & 0xu);
+p[3] = (STRINGLIB_CHAR)(block & 0xu);
+# endif
+#endif
+_q += SIZEOF_LONG;
+p += SIZEOF_LONG / 2;
+}
+q = _q;
+if (q >= e)
+break;
+}
+
+ch = (q[ihi] << 8) | q[ilo];
+q += 2;
+if (!Py_UNICODE_IS_SURROGATE(ch)) {
+#if STRINGLIB_SIZEOF_CH

[issue14811] Syntax error on long UTF-8 lines

2012-05-15 Thread R. David Murray

R. David Murray  added the comment:

By the way, Glenn, what you posted as "the syntax error" (which it was) *is* 
the traceback.  A syntax error on the file directly being compiled will only 
have one line in the traceback.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue14624] Faster utf-16 decoder

2012-05-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset cdcc816dea85 by Antoine Pitrou in branch 'default':
Issue #14624: UTF-16 decoding is now 3x to 4x faster on various inputs.
http://hg.python.org/cpython/rev/cdcc816dea85

--

___
Python tracker 

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



[issue14624] Faster utf-16 decoder

2012-05-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thank you Serhiy! Now committed.

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



[issue14813] Can't build under VS2008 anymore

2012-05-15 Thread Stefan Krah

Stefan Krah  added the comment:

I also would appreciate if the VS 2008 build still worked. Currently I
can't build the 64-bit version with either VS 2008 or VS 2010:


TRACKER : error TRK0002: Failed to execute command: ""C:\Program Files 
(x86)\Microsoft Visual Studio 10 
.0\VC\BIN\amd64\CL.exe" 
@C:\Users\stefan\AppData\Local\Temp\f9f116658f704924b06aa34172aa7fb2.rsp". The  
handle is invalid. 
[C:\Users\stefan\pydev\cpython\PCbuild\make_buildinfo.vcxproj]

--

___
Python tracker 

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



  1   2   >