[issue13376] readline: pre_input_hook not getting called

2011-11-09 Thread Ned Deily

Ned Deily n...@acm.org added the comment:

Since you mention 2.7.1, presumably you are using the Apple-suppled Python 
2.7.1 in OS X.  That Python is not linked with GNU readline, rather the BSD 
libedit library.  As a workaround you could try installing the third-party 
readline package from PyPI which replaces the Python redline module with one 
that is statically linked with GNU readline (see  
http://pypi.python.org/pypi/readline).  On the other hand, if there are more 
differences in behavior between Python readline linked with GNU readline and 
with BSD libedit, they should be documented.

--
nosy: +ned.deily

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



[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2011-11-09 Thread Nicolas Bareil

Nicolas Bareil n...@chdir.org added the comment:

Hello,


Your patch about SSLContext is great! But what can we do about python 2.x?

I understand that we have to keep backward compatibility but something has to 
be done for improving current situation, even Paypal API (*) recommends using 
urllib.urlopen() to check sensitive things on HTTPS :(

If backporting SSLContext into python 2.x is not an option, what do you think 
about a DeprecationWarning at runtime?

Thanks,

(*) https://www.x.com/devzone/articles/getting-started-paypal-django
And even the popular Django paypal module uses urllib2 
https://github.com/johnboxall/django-paypal

--
nosy: +nbareil

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



[issue13377] test_codecs Segmentation fault on Windows

2011-11-09 Thread Vinay Sajip

New submission from Vinay Sajip vinay_sa...@yahoo.co.uk:

test_codecs has started failing on Windows: I can't tell if the problem is in 
the tests.

== CPython 3.3.0a0 (default, Nov 8 2011, 22:34:51) [MSC v.1500 32 bit (Intel)]
==   Windows-7-6.1.7600 little-endian
==   c:\Users\Vinay\Projects\cpython\build\test_python_2612
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=1, 
verbose=0, bytes_warning=2, quiet=0)
[1/1] test_codecs
test_badbom (test.test_codecs.UTF32Test) ... ok
test_bug1098990_a (test.test_codecs.UTF32Test) ... ok
test_bug1098990_b (test.test_codecs.UTF32Test) ... ok
test_bug1175396 (test.test_codecs.UTF32Test) ... ok
test_decoder_state (test.test_codecs.UTF32Test) ... ok
test_errors (test.test_codecs.UTF32Test) ... ok
test_handlers (test.test_codecs.UTF32Test) ... ok
test_issue8941 (test.test_codecs.UTF32Test) ... ok
test_only_one_bom (test.test_codecs.UTF32Test) ... ok
test_partial (test.test_codecs.UTF32Test) ... ok
test_readline (test.test_codecs.UTF32Test) ... ok
test_readlinequeue (test.test_codecs.UTF32Test) ... ok
test_bug1098990_a (test.test_codecs.UTF32LETest) ... ok
test_bug1098990_b (test.test_codecs.UTF32LETest) ... ok
test_bug1175396 (test.test_codecs.UTF32LETest) ... ok
test_errors (test.test_codecs.UTF32LETest) ... ok
test_issue8941 (test.test_codecs.UTF32LETest) ... ok
test_partial (test.test_codecs.UTF32LETest) ... ok
test_readline (test.test_codecs.UTF32LETest) ... ok
test_readlinequeue (test.test_codecs.UTF32LETest) ... ok
test_simple (test.test_codecs.UTF32LETest) ... ok
test_bug1098990_a (test.test_codecs.UTF32BETest) ... ok
test_bug1098990_b (test.test_codecs.UTF32BETest) ... ok
test_bug1175396 (test.test_codecs.UTF32BETest) ... ok
test_errors (test.test_codecs.UTF32BETest) ... ok
test_issue8941 (test.test_codecs.UTF32BETest) ... ok
test_partial (test.test_codecs.UTF32BETest) ... ok
test_readline (test.test_codecs.UTF32BETest) ... ok
test_readlinequeue (test.test_codecs.UTF32BETest) ... ok
test_simple (test.test_codecs.UTF32BETest) ... ok
test_badbom (test.test_codecs.UTF16Test) ... ok
test_bug1098990_a (test.test_codecs.UTF16Test) ... ok
test_bug1098990_b (test.test_codecs.UTF16Test) ... ok
test_bug1175396 (test.test_codecs.UTF16Test) ... ok
test_bug691291 (test.test_codecs.UTF16Test) ... ok
test_decoder_state (test.test_codecs.UTF16Test) ... ok
test_errors (test.test_codecs.UTF16Test) ... ok
test_handlers (test.test_codecs.UTF16Test) ... ok
test_only_one_bom (test.test_codecs.UTF16Test) ... ok
test_partial (test.test_codecs.UTF16Test) ... ok
test_readline (test.test_codecs.UTF16Test) ... ok
test_readlinequeue (test.test_codecs.UTF16Test) ... ok
test_bug1098990_a (test.test_codecs.UTF16LETest) ... ok
test_bug1098990_b (test.test_codecs.UTF16LETest) ... ok
test_bug1175396 (test.test_codecs.UTF16LETest) ... ok
test_errors (test.test_codecs.UTF16LETest) ... ok
test_nonbmp (test.test_codecs.UTF16LETest) ... ok
test_partial (test.test_codecs.UTF16LETest) ... ok
test_readline (test.test_codecs.UTF16LETest) ... ok
test_readlinequeue (test.test_codecs.UTF16LETest) ... ok
test_bug1098990_a (test.test_codecs.UTF16BETest) ... ok
test_bug1098990_b (test.test_codecs.UTF16BETest) ... ok
test_bug1175396 (test.test_codecs.UTF16BETest) ... ok
test_errors (test.test_codecs.UTF16BETest) ... ok
test_nonbmp (test.test_codecs.UTF16BETest) ... ok
test_partial (test.test_codecs.UTF16BETest) ... ok
test_readline (test.test_codecs.UTF16BETest) ... ok
test_readlinequeue (test.test_codecs.UTF16BETest) ... ok
test_bug1098990_a (test.test_codecs.UTF8Test) ... ok
test_bug1098990_b (test.test_codecs.UTF8Test) ... ok
test_bug1175396 (test.test_codecs.UTF8Test) ... ok
test_decoder_state (test.test_codecs.UTF8Test) ... ok
test_lone_surrogates (test.test_codecs.UTF8Test) ... ok
test_partial (test.test_codecs.UTF8Test) ... ok
test_readline (test.test_codecs.UTF8Test) ... ok
test_readlinequeue (test.test_codecs.UTF8Test) ... ok
test_surrogatepass_handler (test.test_codecs.UTF8Test) ... ok
test_bom (test.test_codecs.UTF8SigTest) ... ok
test_bug1098990_a (test.test_codecs.UTF8SigTest) ... ok
test_bug1098990_b (test.test_codecs.UTF8SigTest) ... ok
test_bug1175396 (test.test_codecs.UTF8SigTest) ... ok
test_bug1601501 (test.test_codecs.UTF8SigTest) ... ok
test_partial (test.test_codecs.UTF8SigTest) ... ok
test_readline (test.test_codecs.UTF8SigTest) ... ok
test_readlinequeue (test.test_codecs.UTF8SigTest) ... ok
test_stream_bare (test.test_codecs.UTF8SigTest) ... ok
test_stream_bom (test.test_codecs.UTF8SigTest) ... ok
test_bug1098990_a (test.test_codecs.CP65001Test) ... ok
test_bug1098990_b (test.test_codecs.CP65001Test) ... ok
test_bug1175396 (test.test_codecs.CP65001Test) ... ok
test_decode (test.test_codecs.CP65001Test) ... Fatal Python error: Segmentation 
fault

Current thread 0x0a20:
  File c:\Users\Vinay\Projects\cpython\lib\linecache.py, line 81 in 
updatecache
  File 

[issue13377] test_codecs Segmentation fault on Windows

2011-11-09 Thread Vinay Sajip

Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:

FWIW, stack trace from VS 2008:


   python33.dll!_PyLong_New(int size=0x0002)  Line 145 C
python33.dll!PyLong_FromLong(long ival=0x81b6)  Line 210 + 0x7 
bytesC
python33.dll!_pystat_fromstructstat(win32_stat * st=0x)  Line 
1726 + 0xc bytes  C
python33.dll!posix_do_stat(_object * self=0x1e047e3d, _object * 
args=0x, char * format=0x1e12ffc0, int (const char *, win32_stat *)* 
statfunc=0x1e047e00, char * wformat=0x, int (const wchar_t *, 
win32_stat *)* wstatfunc=0x1e043d60)  Line 1846 + 0x9 bytes  C
python33.dll!posix_stat(_object * self=0x013aa148, _object * 
args=0x02292c50)  Line 3335 + 0x1d bytes   C
python33.dll!PyCFunction_Call(_object * func=0x013aa328, _object * 
arg=0x02292c50, _object * kw=0x)  Line 81 + 0x8 bytesC
python33.dll!call_function(_object * * * pp_stack=0x0021e2fc, int 
oparg=0x)  Line 4001 + 0x9a bytes C
python33.dll!PyEval_EvalFrameEx(_frame * f=0x018c93f8, int 
throwflag=0x)  Line 2628 C
python33.dll!PyEval_EvalCodeEx(_object * _co=0x01b9cac0, _object * 
globals=0x018c93f8, _object * locals=0x, _object * * args=0x01e5a9b4, 
int argcount=0x0002, _object * * kws=0x01e5a9bc, int kwcount=0x, 
_object * * defs=0x017f665c, int defcount=0x0001, _object * 
kwdefs=0x, _object * closure=0x)  Line 3376 + 0xc bytes   C
python33.dll!fast_function(_object * func=0x, _object * * * 
pp_stack=0x0021e418, int n=0x0002, int na=0x0002, int nk=0x)  
Line 4102 + 0x39 bytesC
python33.dll!call_function(_object * * * pp_stack=0x0021e418, int 
oparg=0x)  Line 4022 + 0x10 bytes C
python33.dll!PyEval_EvalFrameEx(_frame * f=0x01e5a870, int 
throwflag=0x)  Line 2628 C
python33.dll!PyEval_EvalCodeEx(_object * _co=0x01b9c980, _object * 
globals=0x01e5a870, _object * locals=0x, _object * * args=0x01e5e45c, 
int argcount=0x0002, _object * * kws=0x01e5e464, int kwcount=0x, 
_object * * defs=0x01b9283c, int defcount=0x0001, _object * 
kwdefs=0x, _object * closure=0x)  Line 3376 + 0xc bytes   C
python33.dll!fast_function(_object * func=0x, _object * * * 
pp_stack=0x0021e534, int n=0x0002, int na=0x0002, int nk=0x)  
Line 4102 + 0x39 bytesC
python33.dll!call_function(_object * * * pp_stack=0x0021e534, int 
oparg=0x)  Line 4022 + 0x10 bytes C
python33.dll!PyEval_EvalFrameEx(_frame * f=0x01e5e310, int 
throwflag=0x)  Line 2628 C
python33.dll!PyEval_EvalCodeEx(_object * _co=0x01b9c8e0, _object * 
globals=0x01e5e310, _object * locals=0x, _object * * args=0x01e5b7d4, 
int argcount=0x0003, _object * * kws=0x01e5b7e0, int kwcount=0x, 
_object * * defs=0x01b9287c, int defcount=0x0001, _object * 
kwdefs=0x, _object * closure=0x)  Line 3376 + 0xc bytes   C
python33.dll!fast_function(_object * func=0x, _object * * * 
pp_stack=0x0021e650, int n=0x0003, int na=0x0003, int nk=0x)  
Line 4102 + 0x39 bytesC
python33.dll!call_function(_object * * * pp_stack=0x0021e650, int 
oparg=0x)  Line 4022 + 0x10 bytes C
python33.dll!PyEval_EvalFrameEx(_frame * f=0x01e5b670, int 
throwflag=0x)  Line 2628 C
python33.dll!PyEval_EvalCodeEx(_object * _co=0x01735610, _object * 
globals=0x01e5b670, _object * locals=0x, _object * * args=0x01e48cb8, 
int argcount=0x0002, _object * * kws=0x01e48cc0, int kwcount=0x, 
_object * * defs=0x0172623c, int defcount=0x0001, _object * 
kwdefs=0x, _object * closure=0x)  Line 3376 + 0xc bytes   C
python33.dll!fast_function(_object * func=0x, _object * * * 
pp_stack=0x0021e76c, int n=0x0002, int na=0x0002, int nk=0x)  
Line 4102 + 0x39 bytesC
python33.dll!call_function(_object * * * pp_stack=0x0021e76c, int 
oparg=0x)  Line 4022 + 0x10 bytes C
python33.dll!PyEval_EvalFrameEx(_frame * f=0x01e48b70, int 
throwflag=0x)  Line 2628 C
python33.dll!PyEval_EvalCodeEx(_object * _co=0x017355c0, _object * 
globals=0x01e48b70, _object * locals=0x, _object * * args=0x01e3b790, 
int argcount=0x0002, _object * * kws=0x01e3b798, int kwcount=0x, 
_object * * defs=0x0172621c, int defcount=0x0001, _object * 
kwdefs=0x, _object * closure=0x)  Line 3376 + 0xc bytes   C
python33.dll!fast_function(_object * func=0x, _object * * * 
pp_stack=0x0021e888, int n=0x0002, int na=0x0002, int nk=0x)  
Line 4102 + 0x39 bytesC
python33.dll!call_function(_object * * * pp_stack=0x0021e888, int 
oparg=0x)  Line 4022 + 0x10 bytes C

[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2011-11-09 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 Your patch about SSLContext is great! But what can we do about python 2.x?

Adding new features to Python 2.7 is certainly not an option.

 what do you think about a DeprecationWarning at runtime?

What API exactly should this deprecate?

--
title: some stdlib modules need to be updated to handle SSL certificate 
validation - some stdlib modules need to be updated to handle SSL  
certificate validation

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



[issue10441] some stdlib modules need to be updated to handle SSL certificate validation

2011-11-09 Thread Nicolas Bareil

Nicolas Bareil n...@chdir.org added the comment:

Martin v. Löwis rep...@bugs.python.org writes:
 what do you think about a DeprecationWarning at runtime?

 What API exactly should this deprecate?

Ooops, lapsus. I was thinking about a RuntimeWarning raised on HTTPS
request (in httplib.HTTPSConnection.connect for instance).

--

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



[issue13377] test_codecs Segmentation fault on Windows

2011-11-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

I may be related to recent changes on codecs. My following commit fixed a 
test_codecs crash, but there is maybe another bug.

changeset:   73466:9042d71962d6
user:Victor Stinner victor.stin...@haypocalc.com
date:Wed Nov 09 00:02:18 2011 +0100
files:   Objects/unicodeobject.c
description:
Fix the code page decoder

 * unicode_decode_call_errorhandler() now supports the PyUnicode_WCHAR_KIND
   kind
 * unicode_decode_call_errorhandler() calls copy_characters() instead of
   PyUnicode_CopyCharacters()

--
nosy: +haypo, loewis

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



[issue13377] test_codecs Segmentation fault on Windows

2011-11-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

The test doesn't crash on our Windows buildbots. Please try to update. If the 
problem does still exist, reopen the issue.

--
resolution:  - fixed
status: open - closed

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



[issue13377] test_codecs Segmentation fault on Windows

2011-11-09 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Why was the change necessary? unicode_decode_call_errorhandler shouldn't be 
called with WSTR strings (i.e. it is only intended to support ready strings).

--

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



[issue13377] test_codecs Segmentation fault on Windows

2011-11-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 Why was the change necessary?

First because unicode_decode_call_errorhandler() was called with the wrong 
argument count:

1.90 -v, outpos, out))
1.91 +v, outpos))

decode_code_page_errors() calls MultiByteToWideChar() which expects a wchar_t* 
buffer.

Compute the maximum character requires to decode the full string. I prefer to 
work on a wchar_t* string to only decode surrogate pairs and computer the 
maximum character once.

decode_code_page_errors() can also be called on a substring of a longer string, 
decode_code_page_strict() can be called for the other part.

--

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



[issue11682] PEP 380 reference implementation for 3.3

2011-11-09 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

In reviewing Zbyszek's doc updates and comparing them against the Grammar, I 
discovered a gratuitous change in the implementation: it allows a bare (i.e. no 
parentheses) 'yield from' as an argument to a function, even when there's 
multiple arguments. By contrast, an ordinary yield expression requires 
parentheses everywhere other than when it's being used as a statement, or as 
the sole expression on the RHS of an assignment.

I'll add a new test to ensure yield from x requires parentheses whenever 
yield x requires them (and fix the Grammar file on the implementation branch 
accordingly).

I've also pushed a fix to the branch for the refleak Yury pointed out (once I 
actually ran regrtest in refleak hunting mode it also pointed out that there 
was a problem, so I know his suggested change definitely fixed it).

--

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



[issue11682] PEP 380 reference implementation for 3.3

2011-11-09 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

OK, the bitbucket repo now has a more sane version of the new Grammar ('yield 
from' now requires parentheses wherever 'yield' does).

The updated test_grammar does a more thorough check of the expected acceptance 
and rejection of yield expressions in various situations and the overly 
sensitive test in test_parser (that checked for an exact expected parse tree 
output) is gone.

--

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



[issue13359] urllib2 doesn't escape spaces in http requests

2011-11-09 Thread Krishna Bharadwaj

Krishna Bharadwaj krishna.bm...@gmail.com added the comment:

I have used the quote method to percent encode the url for spaces and similar 
characters. This is my first patch. Please let me know if there is anything 
wrong. I will correct and re-submit it. I ran the test_urllib2.py which gave an 
OK for 34 tests.

Changes are made in two instances:
1. in the open method.
2. in the __init__ of Request class to ensure that the same issue is addressed 
at the time of creating Request objects.

--
keywords: +patch
nosy: +krisys
Added file: http://bugs.python.org/file23642/issue13359.patch

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


Added file: http://bugs.python.org/file23643/2506e49b9f71.diff

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

Another changeset. Hopefully, final :-).

Please, review.

--

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



[issue13375] Provide a namedtuple style interface for os.walk values

2011-11-09 Thread Krishna Bharadwaj

Krishna Bharadwaj krishna.bm...@gmail.com added the comment:

Have included a patch which alters the walk method to yield a namedtuple and 
the members can be accessed by dirpath, dirnames and filenames.

Got the following results after running the test. 

Ran 61 tests in 0.080s

OK (skipped=4)

Please let me know if the same can be achieved in a better way.

--
keywords: +patch
nosy: +krisys
Added file: http://bugs.python.org/file23644/issue13375.diff

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



[issue13375] Provide a namedtuple style interface for os.walk values

2011-11-09 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc amaur...@gmail.com added the comment:

This patch needs a test at least.
Also, the walktuple type should be defined only once, at the module level 
(but then, there may be a boostrap issue, I don't know).

--
nosy: +amaury.forgeotdarc

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



[issue13375] Provide a namedtuple style interface for os.walk values

2011-11-09 Thread Krishna Bharadwaj

Krishna Bharadwaj krishna.bm...@gmail.com added the comment:

Hey Amaury,

can you tell me if the following test cases would suffice? If not, I can think 
of adding something more comprehensive. Also, can you provide some pointers 
related to the bootstrap issue so that I can look at the same?

--
Added file: http://bugs.python.org/file23645/issue13375_tests.diff

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

+   increases this value, c:func:`devpoll` will return a possible
+   incomplete list of active file descriptors.

I think this should change to:

+   increases this value, c:func:`devpoll` will return a possibly
+   incomplete list of active file descriptors.

or even better:

+   increases this value, c:func:`devpoll` may return an
+   incomplete list of active file descriptors.

Cheers

--

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

Thanks, Ross. Your suggestion has been committed in my branch.

Waiting for more feedback.

--

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



[issue13374] Deprecate usage of the Windows ANSI API in the nt module

2011-11-09 Thread sbt

sbt shibt...@gmail.com added the comment:

 Functions like os.execv() or os.readlink() are not deprecated because 
 the underlying C function really uses a bytes API (execv and readlink).

Probably os.execv() should be implemented on Windows with _wexecv() instead of 
_execv().  Likewise for other functions which have wide versions.  Or maybe 
it wouldn't be worth the effort, since it would mean writing separate Windows 
implementations.

I don't know what you mean about os.readlink() though: the Windows 
implementation uses CreateFileW() and DeviceIoControl().

--
nosy: +sbt

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



[issue13374] Deprecate usage of the Windows ANSI API in the nt module

2011-11-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

 Probably os.execv() should be implemented on Windows with _wexecv() instead
 of _execv(). 

That's a different story. Would you like to implement it? If yes, please open a 
new issue.

 I don't know what you mean about os.readlink() though: the Windows
 implementation uses CreateFileW() and DeviceIoControl().

Oops, you are right. The Windows implement only accepts Unicode, so no 
deprecation warning is needed here.

--

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



[issue3754] cross-compilation support for python build

2011-11-09 Thread David Marqvar Nielsen

Changes by David Marqvar Nielsen da...@marqvar.dk:


--
nosy: +marqvar

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

Is write()ing a devpoll fd a blocking operation in the kernel?
Does it need to have Py_BEGIN_ALLOW_THREADS around it?
The same question applies for open()ing it.

Obviously, the ioctl() call *is* blocking :-)

--

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

Also, you can use Py_RETURN_NONE instead of:
+Py_INCREF(Py_None);
+return Py_None;

--

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Antoine Pitrou

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


--
nosy: +pitrou

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



[issue11427] ctypes from_buffer no longer accepts bytes

2011-11-09 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy: +haypo

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



[issue13093] Redundant code in PyUnicode_EncodeDecimal()

2011-11-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

The code is also present in Python 2.7 and 3.2.

--
nosy: +haypo
versions: +Python 2.7, Python 3.2

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



[issue13093] Redundant code in PyUnicode_EncodeDecimal()

2011-11-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

PyUnicode_EncodeDecimal() was used in Python 2 by int, long and complex 
constructors. In Python 3, the function is no more used: it has been replaced 
by _PyUnicode_TransformDecimalAndSpaceToASCII().

--

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



[issue13093] Redundant code in PyUnicode_EncodeDecimal()

2011-11-09 Thread STINNER Victor

Changes by STINNER Victor victor.stin...@haypocalc.com:


--
nosy: +loewis

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



[issue13093] Redundant code in PyUnicode_EncodeDecimal()

2011-11-09 Thread Stefan Krah

Stefan Krah stefan-use...@bytereef.org added the comment:

Looking at it again, the intention was probably to increment
collend so that it points to the first non-garbage character
(or '\0'). If that's the case, the loop should be something
like this:

  while (collend  end) {
  if ((0  *collend  *collend  256) ||
  Py_UNICODE_ISSPACE(*collend) ||
  Py_UNICODE_TODECIMAL(*collend) = 0)
  break;
  collend++;
  }


I can understand if no one wants to touch this given that
the function is deprecated, provided that you agree that
the existing code is redundant but harmless; i.e. it cannot
enter an infinite loop.

--

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



[issue11427] ctypes from_buffer no longer accepts bytes

2011-11-09 Thread Santoso Wijaya

Changes by Santoso Wijaya santoso.wij...@gmail.com:


--
nosy: +santa4nt
versions: +Python 3.3

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



[issue13375] Provide a namedtuple style interface for os.walk values

2011-11-09 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

Perhaps Raymond has a different view, but I don't this patch makes anything 
more clear. There's only three things to remember and its convenient to unpack 
it in the loop like

for path, dirs, files in os.walk(somewhere):
...

--
nosy: +benjamin.peterson, rhettinger

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



[issue11427] ctypes from_buffer no longer accepts bytes

2011-11-09 Thread Santoso Wijaya

Santoso Wijaya santoso.wij...@gmail.com added the comment:

From what I understand, even in 2.7 the exception is expected. The doc for 
`from_buffer` says:

 The source object must support the writeable buffer interface.

Is there any reason why `from_buffer_copy` cannot be used, instead? The latter 
only requires readable buffer interface.

--

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

They are operations potentially slow, there are not realtime specifications.

My machine is quite capable (16 CPUs), but let's see what a bit of DTRACE 
scripting tells us:

First, let's time the open:


syscall::open*:entry
/copyinstr(arg0)==/dev/poll/
{
self-ts = timestamp;
}

syscall::open*:return
/self-ts/
{
@stats = quantize(timestamp-self-ts);
self-ts = 0;
}


The result, times in nanoseconds:


   value  - Distribution - count
2048 | 0
4096 | 4497743  
8192 | 17358
   16384 | 1592 
   32768 | 2046 
   65536 | 812  
  131072 | 374  
  262144 | 0 


Most opens finish in 4 microseconds, but we have a handful of slow openings 
of hundred of microseconds.

Anyway, argueing with the GIL here is a nonissue, since the open is only done 
at object creation, and a sane program will only create a handful of devpoll 
objets.

Let's see now the write:


syscall::open*:entry
/copyinstr(arg0)==/dev/poll/
{
self-ts = timestamp;
}

syscall::open*:return
/self-ts/
{
@stats = quantize(timestamp-self-ts);
self-ts = 0;
}



The results for a single descriptor registered:


   value  - Distribution - count
 256 | 0
 512 | 4102701  
1024 | 28514
2048 | 11269
4096 | 537  
8192 | 245  
   16384 | 377  
   32768 | 193  
   65536 | 134  
  131072 | 71   
  262144 | 0  


Most writes are really fast, half a microsecond, but we have sporadic latencies 
of a hundred of microseconds.

Re-registering 200 sockets per loop, I have:


   value  - Distribution - count
 512 | 0
1024 | 50   
2048 | 94   
4096 | 157  
8192 |@@@  1112314  
   16384 |@22977
   32768 | 1584 
   65536 | 842  
  131072 | 168  
  262144 | 0 


Most writes takes around 8 microseconds.

So now the problem is to estimate how much time I need to release  readquire 
the GIL. For that, and while we don't have DTRACE integration in python (my 
next project, I hope), I change sourcecode to add a manual probe using the 
Solaris High Resolution timers, I get a median time of around 550 nanoseconds 
(half a microsecond), with a few spikes, when the GIL is not contested. 

So, unlocking the GIL is adding around half microsecond to the syscalls. This 
is fast, but comparable with the syscall actual duration. Liberating the GIL is 
doubling the time to registerunregister a socket (supposely we are doing a 
single socket per iteration, something realistic in real code).

Being realistic, any work we do with the descriptors (like actually reading or 
writing it) is going to make this 0.5 microsecond gain pointless. Freeing the 
GIL, we are protected of any kernel contention, and playing for the rules :-).

Anyway I am open to feedback.

PS: I also checked with GIL contention, and results are comparable. That is 
surprising, maybe related to the GIL improvements in 3.3. I haven't 
investigated the issue further.

--

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


Added file: http://bugs.python.org/file23646/9d687fdd924d.diff

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

New changeset, after Ross feedback. Thanks!.

--

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



[issue13309] test_time fails: time data 'LMT' does not match format '%Z'

2011-11-09 Thread Nadeem Vawda

Changes by Nadeem Vawda nadeem.va...@gmail.com:


--
nosy: +nadeem.vawda

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Ross Lagerwall

Ross Lagerwall rosslagerw...@gmail.com added the comment:

That was thorough :-) Seems OK though.

+if (n  size) {
+PyErr_SetString(PyExc_IOError, failed to write all pollfds. 
+Please, report in http://bugs.python.org/;);

If n  size, it's not a Python error is it? I would say it's the OS's fault.

Otherwise, it looks good... although I don't have currently access to a Solaris 
box to test it.

--

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

The timing for the GIL I am providing is for releaseacquiring. That is, all 
the work. In fact I am having in count too the syscall inside the 
releaseacquire, to account for cache issues.

That is, between the release and the acquire, there is a real syscall. Of 
course, I am not timing it.

So, the timing I am providing is accurate.

--

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 That was thorough :-) Seems OK though.
 
 +if (n  size) {
 +PyErr_SetString(PyExc_IOError, failed to write all pollfds. 
 +Please, report in http://bugs.python.org/;);
 
 If n  size, it's not a Python error is it? I would say it's the OS's fault.

No, but it's a Python error if Python wrongly assumes that write() won't
return a partial result. Ideally write() should be retried in a loop
until everything is written out.

--

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



[issue13093] Redundant code in PyUnicode_EncodeDecimal()

2011-11-09 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

AFAICT, this code was introduced in 0337dad8403e, implementing PEP 293 (see 
#432401). The intention clearly was what Stefan figured out: compute the list 
of unencodable characters, to pass the longest run of unencodable characters to 
the error handler.

Fixing this in this respect is fine with me for all branches.

--

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



[issue13374] Deprecate usage of the Windows ANSI API in the nt module

2011-11-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

Updated patch:

 * os.rename(), os.symlink(), os.link() accept (bytes, str) and (str, bytes) 
again
 * ensure that the warning is emited after parsing arguments, not before (to 
not emit a warning if an int is passed instead of bytes or str)
 * add a test on os.open()

--
Added file: http://bugs.python.org/file23647/deprecate_win_bytes_api-2.patch

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



[issue13374] Deprecate usage of the Windows ANSI API in the nt module

2011-11-09 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

 Probably os.execv() should be implemented on Windows with _wexecv()
 instead of _execv().  Likewise for other functions which have wide
 versions.  Or maybe it wouldn't be worth the effort, since it would
 mean writing separate Windows implementations.

Writing separate Windows versions has a long tradition in posixmodule.c,
so in principle it's fine. It still may not be worth the effort since
the function is deprecated in favor of the subprocess module. However,
if code was contributed in that direction, we would likely accept it.

--

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



[issue13374] Deprecate usage of the Windows ANSI API in the nt module

2011-11-09 Thread STINNER Victor

STINNER Victor victor.stin...@haypocalc.com added the comment:

deprecate_win_bytes_api-2.patch:
 * test_os.py: catch_warning() should be moved into test_link_bytes()
 * the change on Py_GetFinalPathNameByHandleA may be done in another commit

--

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



[issue12442] shutil.disk_usage()

2011-11-09 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset bdb3f0e7e268 by Victor Stinner in branch 'default':
Issue #12442: nt._getdiskusage() is now using the Windows Unicode API
http://hg.python.org/cpython/rev/bdb3f0e7e268

--

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



[issue13375] Provide a namedtuple style interface for os.walk values

2011-11-09 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Like any named tuple, the benefits lie in the better repr, and the fact
that if you only want some fields you don't have to unpack the whole tuple.
It's also easier to write variant APIs that add additional fields
accessible only by name.

--

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



[issue13375] Provide a namedtuple style interface for os.walk values

2011-11-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Like any named tuple, the benefits lie in the better repr, and the fact
 that if you only want some fields you don't have to unpack the whole
 tuple.

But, given the common idiom shown by Benjamin, how likely is it that you 
manipulate the tuple as-is?

--
nosy: +pitrou

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



[issue6397] Implementing Solaris /dev/poll in the select module

2011-11-09 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

The problem with partial writes is that the data is not an unstructured stream 
of bytes, but a concrete binary dump. You can not simply retry again.

My bet is that /dev/poll neves does partial writes.

If I am mistaken, I will bug the Illumos people to help me to solve it. So far, 
this seems a theorical problema.

Just in case it is not, we raise an exception and urge the programmer to report 
us the issue.

The other option would be to try to be clever and do things like retrying if 
the partial write is a multiple of the struct size, but what if it not so?.

Instead of guessing and play games, I rather prefer to know if this is actually 
a problem in the wild. In my tests, with 65530 sockets, I never saw this 
impossible exception.

--

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



[issue13374] Deprecate usage of the Windows ANSI API in the nt module

2011-11-09 Thread Santoso Wijaya

Changes by Santoso Wijaya santoso.wij...@gmail.com:


--
nosy: +santa4nt

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



[issue13378] Change the variable nsmap from global to instance (xml.etree.ElementTree)

2011-11-09 Thread Nekmo

New submission from Nekmo nin...@gmail.com:

Currently, the mapping of namespaces is global and can cause failures if 
multiple instances are used or in multithreading. The variable is in 
xml.etree.ElementTree._namespace_map. I ask it to be switched to 
xml.etree._Element instance.

--
components: XML
messages: 147378
nosy: Nekmo
priority: normal
severity: normal
status: open
title: Change the variable nsmap from global to instance 
(xml.etree.ElementTree)
type: feature request
versions: Python 3.2

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



[issue13378] Change the variable nsmap from global to instance (xml.etree.ElementTree)

2011-11-09 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

Tagging this as targeting 3.3.

Nekmo, could you possibly poste some code showing the problem?

--
nosy: +jcea
versions: +Python 3.3 -Python 3.2

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



[issue13378] Change the variable nsmap from global to instance (xml.etree.ElementTree)

2011-11-09 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


--
nosy: +flox

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



[issue9523] Improve dbm modules

2011-11-09 Thread Jesús Cea Avión

Changes by Jesús Cea Avión j...@jcea.es:


--
nosy: +jcea

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



[issue13378] Change the variable nsmap from global to instance (xml.etree.ElementTree)

2011-11-09 Thread Nekmo

Nekmo nin...@gmail.com added the comment:

In my case, I have several clients, and they define the namespaces. I am 
interested in return the same namespace that they gave me, for example, the 
client A gives me this:

house:iq xmlns:house=http://localhost/house; /

To name the namespace, I set it at nsmap:

 import xml.etree.ElementTree as etree
 etree.register_namespace('house', 'http://localhost/house')
 etree._namespace_map
{'http://localhost/house': 'house',
 'http://purl.org/dc/elements/1.1/': 'dc',
 'http://schemas.xmlsoap.org/wsdl/': 'wsdl',
 'http://www.w3.org/1999/02/22-rdf-syntax-ns#': 'rdf',
 'http://www.w3.org/1999/xhtml': 'html',
 'http://www.w3.org/2001/XMLSchema': 'xs',
 'http://www.w3.org/2001/XMLSchema-instance': 'xsi',
 'http://www.w3.org/XML/1998/namespace': 'xml'}

Thus, keeping the name of the namespace:
 etree.tostring(etree.Element('{http://localhost/house}iq'))
b'house:iq xmlns:house=http://localhost/house; /'

But if I have a client B, which uses a different name, and run in parallel, 
problems can occur:

home:iq xmlns:home=http://localhost/house; /

 import xml.etree.ElementTree as etree
 etree.register_namespace('home', 'http://localhost/house')
 etree._namespace_map
{'http://localhost/house': 'home',
 'http://purl.org/dc/elements/1.1/': 'dc',
 'http://schemas.xmlsoap.org/wsdl/': 'wsdl',
 'http://www.w3.org/1999/02/22-rdf-syntax-ns#': 'rdf',
 'http://www.w3.org/1999/xhtml': 'html',
 'http://www.w3.org/2001/XMLSchema': 'xs',
 'http://www.w3.org/2001/XMLSchema-instance': 'xsi',
 'http://www.w3.org/XML/1998/namespace': 'xml'}

Therefore, I ask that _namespace_map is within etree._Element instance, and not 
global

--

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



[issue13379] Wrong Unicode version in unicodedata docstring

2011-11-09 Thread Florent Xicluna

New submission from Florent Xicluna florent.xicl...@gmail.com:

The unicodedata docstring says 5.2 multiple times.


Modules/unicodedata.c:   unicodedata -- Provides access to the Unicode 5.2 data 
base.
Modules/unicodedata.c:   Data was extracted from the Unicode 5.2 
UnicodeData.txt file.
Modules/unicodedata.c:5.2.0 which is publically available from 
ftp://ftp.unicode.org/.\n\
Modules/unicodedata.c:UnicodeData File Format 5.2.0 (see\n\


However:

 import unicodedata
 unicodedata.unidata_version
'6.0.0'

--
components: Unicode
keywords: easy
messages: 147381
nosy: ezio.melotti, flox
priority: normal
severity: normal
stage: needs patch
status: open
title: Wrong Unicode version in unicodedata docstring
type: behavior
versions: Python 3.2, Python 3.3

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



[issue13297] xmlrpc.client could accept bytes for input and output

2011-11-09 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

Updated with documentation.

--
nosy: +effbot, fdrake, skip.montanaro
Added file: http://bugs.python.org/file23648/issue13291_xmlrpc_v2.diff

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



[issue13297] xmlrpc.client could accept bytes for input and output

2011-11-09 Thread Florent Xicluna

Changes by Florent Xicluna florent.xicl...@gmail.com:


Removed file: http://bugs.python.org/file23648/issue13291_xmlrpc_v2.diff

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



[issue13297] xmlrpc.client could accept bytes for input and output

2011-11-09 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

Ooops wrong patch.

--
Added file: http://bugs.python.org/file23649/issue13297_xmlrpc_bytes_v2.diff

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



[issue11937] Interix support

2011-11-09 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

Closing. If anybody disagrees, reopen.

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

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



[issue13373] Unexpected blocking call to multiprocessing.Queue.get with a timeout

2011-11-09 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset e7b6dca28a2f by Antoine Pitrou in branch '2.7':
Issue #13373: multiprocessing.Queue.get() could sometimes block indefinitely
http://hg.python.org/cpython/rev/e7b6dca28a2f

New changeset 9328080a19c0 by Antoine Pitrou in branch '3.2':
Issue #13373: multiprocessing.Queue.get() could sometimes block indefinitely
http://hg.python.org/cpython/rev/9328080a19c0

New changeset f34b4e250b44 by Antoine Pitrou in branch 'default':
Issue #13373: multiprocessing.Queue.get() could sometimes block indefinitely
http://hg.python.org/cpython/rev/f34b4e250b44

--
nosy: +python-dev

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



[issue13373] Unexpected blocking call to multiprocessing.Queue.get with a timeout

2011-11-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Patch committed, thank you for contributing!

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

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



[issue13322] buffered read() and write() does not raise BlockingIOError

2011-11-09 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Hi,

 Testing the patch a bit more thoroughly, I found that data received
 from the readable end of the pipe can be corrupted by the C
 implementation.  This seems to be because two of the previously
 dormant codepaths did not properly maintain the necessary invariants.

Ouch. Were they only non-blocking codepaths?

 in two places.  However, I really do not know what all the attributes
 mean.  (Should self-raw_pos also be modified...?)

raw_pos is the position which the underlying raw stream is currently at.
It only needs to be modified when a successful write(), read() or seek()
is done on the raw stream.

Another comment: you set errno to EAGAIN, but it is not sure that was
the actual errno raised by the raw stream (although that's quite
likely). You might want to reflect the actual C errno (but you'd better
set it to 0 before the system call, then).

--

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



[issue4111] Add Systemtap/DTrace probes

2011-11-09 Thread Jesús Cea Avión

Jesús Cea Avión j...@jcea.es added the comment:

Anybody still working on this?.

We missed the 2.7 boat. DO NOT MISS THE 3.3 ONE!!! :-)

--

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



[issue4111] Add Systemtap/DTrace probes

2011-11-09 Thread Brett Hoerner

Changes by Brett Hoerner bretthoer...@gmail.com:


--
nosy:  -bretthoerner

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



[issue13229] Improve tools for iterating over filesystem directories

2011-11-09 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

I changed the package name to walkdir: 
https://bitbucket.org/ncoghlan/walkdir/overview

--

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



[issue13375] Provide a namedtuple style interface for os.walk values

2011-11-09 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Why provide any namedtuple interface in any context? After all, you can just 
unpack them to individual variables.

The point is that the values produced by os.walk() *aren't* just an arbitrary 
3-tuple - they have a definite API for describing a directory: the base path, 
then lists of relative names for any subdirectories and the relative names for 
any files. Why not make that explicit in the objects produced instead of 
leaving it as merely implied?

This idea actually came out of the proposal for providing an itertools-inspired 
toolset for manipulating the output of os.walk() style iteration (#13229 and 
https://bitbucket.org/ncoghlan/walkdir/overview).

I'll be adding this feature to walkdir regardless, but it seems to make more 
sense to offer it as standard behaviour.

--

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



[issue13375] Provide a namedtuple style interface for os.walk values

2011-11-09 Thread Benjamin Peterson

Benjamin Peterson benja...@python.org added the comment:

2011/11/9 Nick Coghlan rep...@bugs.python.org:

 Nick Coghlan ncogh...@gmail.com added the comment:

 Why provide any namedtuple interface in any context? After all, you can just 
 unpack them to individual variables.

 The point is that the values produced by os.walk() *aren't* just an arbitrary 
 3-tuple - they have a definite API for describing a directory: the base path, 
 then lists of relative names for any subdirectories and the relative names 
 for any files. Why not make that explicit in the objects produced instead of 
 leaving it as merely implied?

You could make this argument for any function that returns a tuple to
return multiple distinct values. I claim that the API in this case is
already simple enough that adding a nametuple does nothing but feature
bloat. What does having a dirinfo object with attributes tell you
that simply unpacking the tuple doesn't? You have to remember names in
both cases.


 This idea actually came out of the proposal for providing an 
 itertools-inspired toolset for manipulating the output of os.walk() style 
 iteration (#13229 and https://bitbucket.org/ncoghlan/walkdir/overview).

 I'll be adding this feature to walkdir regardless, but it seems to make more 
 sense to offer it as standard behaviour.

Indeed, I think using a namedtuple seems more appropriate for your
fancier api.

--

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



[issue11427] ctypes from_buffer no longer accepts bytes

2011-11-09 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

Hmmm... I take back what I said before (not sure what I was thinking), I 
don't think this is a regression.  If this ever did work, it must have 
been a bug.  For one reason, Python byte strings are now immutable.  
Allowing their memory to be indirectly mutated in Python via buffers 
created from 'from_buffer' would be very bad.

Also, I can't reproduce the reported behavior with 3.1.3:

Python 3.1.3 (unknown, Nov  9 2011, 19:57:58) 
[GCC 4.6.1 20110908 (Red Hat 4.6.1-9)] on linux2
Type help, copyright, credits or license for more information.
 import ctypes
 (ctypes.c_char*5).from_buffer(b'abcde')
Traceback (most recent call last):
  File stdin, line 1, in module
TypeError: expected an object with a writable buffer interface

Are you sure it was 3.1.3?  At first I thought you might be using
3.0a, since bytes are mutable in that version, but 'from_buffer'
didn't exist in those times.

--

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



[issue13375] Provide a namedtuple style interface for os.walk values

2011-11-09 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

I'm persuaded that there's no major gain to be had in building this in at the 
base layer - it's easy enough to add in a higher level API.

--
resolution:  - rejected
status: open - closed

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



[issue13379] Wrong Unicode version in unicodedata docstring

2011-11-09 Thread Ezio Melotti

Changes by Ezio Melotti ezio.melo...@gmail.com:


--
assignee:  - ezio.melotti
keywords: +needs review, patch
stage: needs patch - commit review
Added file: http://bugs.python.org/file23650/issue13379.diff

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



[issue13380] ctypes: add an internal function for reseting the ctypes caches

2011-11-09 Thread Meador Inge

New submission from Meador Inge mead...@gmail.com:

Currently it is possible to somewhat easily get false positives for reference 
leaks when running the ctypes regression tests with -R.  See issue13250 for an 
example where I got tripped up.  The reason is that the ctypes caches are not 
cleared in between test runs like they are with some of the other modules that 
cache objects.

The attached patch adds an internal function for reseting the ctypes caches.  
regrtest.py is then fixed up to use it.  Finally, two tests
that previously relied on the caching being present to work in back-to-back 
runs have been fixed.  In particular, the tests were written to do something 
like:

# Global
dll = CDLL(_ctypes_test.__file__)

# Local to test
f = dll._testfunc_callback_i_if
f.restype = c_int

MyCallback = CFUNCTYPE(c_int, c_int)

def callback(value)
return value

cb = MyCallback(callback)
result = f(-10, cb)

f.argtypes = [c_int, MyCallback]
cb = MyCallback(callback)
result = f(-10, cb)

Thus when run in back-to-back runs where caching is cleared in between you 
effectively get:

# Global
dll = CDLL(_ctypes_test.__file__)

# Local to test
f = dll._testfunc_callback_i_if
f.restype = c_int

MyCallback = CFUNCTYPE(c_int, c_int)

def callback(value):
return value

cb = MyCallback(callback)
result = f(-10, cb)

f.argtypes = [c_int, MyCallback]
cb = MyCallback(callback)
result = f(-10, cb)

_reset_cache()

f = dll._testfunc_callback_i_if
f.restype = c_int

MyCallback = CFUNCTYPE(c_int, c_int)

cb = MyCallback(callback)
result = f(-10, cb)

which causes:

types.ArgumentError: argument 2: class 'TypeError': expected CFunctionType 
instance instead of CFunctionType

because the final MyCallback instance passed to f is not of the same type as 
the MyCallback type saved in f.argtypes.  The fix is to set f.argtypes to None 
at the beginning of each test.

I would also like to commit this to 2.7 and 3.2.  It will make fixing true 
reference leaks in those branches easier.

OK?

--
assignee: meador.inge
components: ctypes
files: ctypes-reset-cache.patch
keywords: patch
messages: 147394
nosy: amaury.forgeotdarc, belopolsky, meador.inge
priority: normal
severity: normal
stage: patch review
status: open
title: ctypes: add an internal function for reseting the ctypes caches
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23651/ctypes-reset-cache.patch

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



[issue13250] ctypes: reference leak in POINTER code

2011-11-09 Thread Meador Inge

Meador Inge mead...@gmail.com added the comment:

I opened issue13380 for fixing the ctypes regrtest caching problem.

--

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



[issue13379] Wrong Unicode version in unicodedata docstring

2011-11-09 Thread Florent Xicluna

Florent Xicluna florent.xicl...@gmail.com added the comment:

I would change the last sentence with something like:

+   unicodedata -- Provides access to the Unicode database.
 
+   Data was extracted from the UnicodeData.txt file.
+   The current version number is reported in unidata_version constant.


LGTM.

--

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



[issue13379] Wrong Unicode version in unicodedata docstring

2011-11-09 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 6ddda809ea8c by Ezio Melotti in branch '3.2':
#13379: update Unicode version in unicodedata docstrings and comments.
http://hg.python.org/cpython/rev/6ddda809ea8c

New changeset 5fdd0c8032d0 by Ezio Melotti in branch 'default':
#13379: merge with 3.2.
http://hg.python.org/cpython/rev/5fdd0c8032d0

--
nosy: +python-dev

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



[issue13379] Wrong Unicode version in unicodedata docstring

2011-11-09 Thread Ezio Melotti

Ezio Melotti ezio.melo...@gmail.com added the comment:

Fixed, thanks for the report and the review.

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

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