[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Hmm. Without the ability to reproduce this effect, it will be difficult for me 
to 
get rid of him. What times for StringIO, append/join, unpatched BytesIO? Do 
this happen with a little different numbers (n=1500, 1600,...,3000)?

--

___
Python tracker 

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



[issue14579] CVE-2012-2135: Vulnerability in the utf-16 decoder after error handling

2012-07-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> There are spurious print() calls in the 2.7 patch.

Oh, my inattentiveness. Thank you for pushing, Antoine. And thank Martin for 
review.

--

___
Python tracker 

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



[issue15063] Source code links for JSON documentation

2012-07-20 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

I am with Éric on this. Looking at json/decoder.py and json/encoder.py, I too 
feel that source link may not be helpful as much as it is helpful for others. 
Docs are best here. I am closing this report. Thanks!

--
nosy: +orsenthil
resolution:  -> wont fix
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



[issue3367] Uninitialized value read in parsetok.c

2012-07-20 Thread Meador Inge

Meador Inge  added the comment:

I can still reproduce the parsetok.c problem on the 'default' branch using the 
CTRL+D method Stefan described.

--

___
Python tracker 

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



[issue15410] urllib.request.Request.is_unverifiable deprecation documentation is incorrect

2012-07-20 Thread Meador Inge

Changes by Meador Inge :


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



[issue15410] urllib.request.Request.is_unverifiable deprecation documentation is incorrect

2012-07-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f39895c55699 by Meador Inge in branch 'default':
Issue #15410: Fix the urllib.request.Request.is_unverifiable deprecation 
documentation.
http://hg.python.org/cpython/rev/f39895c55699

--
nosy: +python-dev

___
Python tracker 

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



[issue15410] urllib.request.Request.is_unverifiable deprecation documentation is incorrect

2012-07-20 Thread Meador Inge

New submission from Meador Inge :

While reviewing the change for issue15409 I noticed that the 'urlib.request' 
documentation has an error in the deprecation note for 
'urllib.request.Request.is_unverifiable' [1]:

"""
Deprecated in 3.3, use Request.is_unverifiable.
"""

The deprecation text of 'is_unverifiable' shouldn't be recommending 
'is_unverifiable' as a replacement :-)  The text should actually read:

"""
Deprecated in 3.3, use Request.unverifiable.
"""

I will patch this shortly.

[1] 
http://docs.python.org/dev/library/urllib.request.html#urllib.request.Request.is_unverifiable

--
assignee: meador.inge
components: Documentation
messages: 165990
nosy: meador.inge
priority: normal
severity: normal
stage: needs patch
status: open
title: urllib.request.Request.is_unverifiable deprecation documentation is 
incorrect
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



[issue15409] Deprecation Warning fix on cookiejar module

2012-07-20 Thread Meador Inge

Meador Inge  added the comment:

Thanks for the patch!

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



[issue15409] Deprecation Warning fix on cookiejar module

2012-07-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset ea8078365d3b by Meador Inge in branch 'default':
Issue #15409: Replace use of deprecated urllib.request.Request methods in 
http.cookijar
http://hg.python.org/cpython/rev/ea8078365d3b

--
nosy: +python-dev

___
Python tracker 

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



[issue14579] CVE-2012-2135: Vulnerability in the utf-16 decoder after error handling

2012-07-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks for the patches, Serhiy! They're now pushed.

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



[issue14579] CVE-2012-2135: Vulnerability in the utf-16 decoder after error handling

2012-07-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4cadf91aaddd by Antoine Pitrou in branch '2.7':
Issue #14579: Fix error handling bug in the utf-16 decoder.
http://hg.python.org/cpython/rev/4cadf91aaddd

--

___
Python tracker 

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



[issue14579] CVE-2012-2135: Vulnerability in the utf-16 decoder after error handling

2012-07-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 034ff986019d by Antoine Pitrou in branch '3.2':
Issue #14579: Fix CVE-2012-2135: vulnerability in the utf-16 decoder after 
error handling.
http://hg.python.org/cpython/rev/034ff986019d

New changeset 118fe0ee6921 by Antoine Pitrou in branch 'default':
Port additional tests from #14579 (the issue is already fixed).
http://hg.python.org/cpython/rev/118fe0ee6921

--
nosy: +python-dev

___
Python tracker 

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



[issue14579] CVE-2012-2135: Vulnerability in the utf-16 decoder after error handling

2012-07-20 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
stage: test needed -> commit review

___
Python tracker 

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



[issue14579] CVE-2012-2135: Vulnerability in the utf-16 decoder after error handling

2012-07-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

There are spurious print() calls in the 2.7 patch.

--

___
Python tracker 

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



[issue15360] Behavior of assigning to __dict__ is not documented

2012-07-20 Thread Davide Rizzo

Davide Rizzo  added the comment:

Amaury, I don't honestly know, I would have proposed something otherwise.

I have been advised on #python (Freenode) not to assign to obj.__dict__ because 
its behaviour changes between versions and implementations, but I wouldn't know 
what has changed between CPython version.

One obscure thing is what can be assigned to __dict__. For class dicts no 
assignment is allowed. Object dicts can be assigned dict objects. If you try to 
assign a non-dict mapping it will complain.

However you can assign a dict-derived object, something like:

class SillyDict(dict):
def __getitem__(self, key):
return "hello"

obj.__dict__ = SillyDict()

Unfortunately accessing the attributes of obj will still use PyDict_* 
functions, thus ignoring any magic methods.

PyPy's behavior is slightly different. A class __dict__ attribute still is read 
only, but you can assign any mapping object to an object __dict__.

--

___
Python tracker 

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



[issue15409] Deprecation Warning fix on cookiejar module

2012-07-20 Thread Flávio Ribeiro

Flávio Ribeiro  added the comment:

wow :) thank you!

--

___
Python tracker 

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Well, with the latest patch I get:

$ ./python -m timeit -s "import io; n=2000; d=[b'a'*n,b'bb'*n,b'ccc'*n]*1000"  
"s=io.BytesIO(); w=s.write"  "for x in d: w(x)"  "s.getvalue()"
1000 loops, best of 3: 982 usec per loop

$ ./python -m timeit -s "import io; n=2000; d=[b'a'*n,b'bb'*n,b'ccc'*n]*1000"  
"s=io.BytesIO(); w=s.write"  "for x in d: w(x)"  "global y; y = s.getvalue()"
100 loops, best of 3: 4.79 msec per loop

--

___
Python tracker 

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> I think you can run the benchmark yourself (I ran it under Linux).

I don't see any differences.

--

___
Python tracker 

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> > There seems to be a problem with the patch: when you store the
> getvalue() result somewhere (instead of discarding it), things get
> much slower:
> 
> This problem exists with the new patch?

I think you can run the benchmark yourself (I ran it under Linux).

--

___
Python tracker 

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> Under Windows (64-bit Windows 7 on a  VirtualBox VM), the patch increases 
> performance slightly but not as much as under Linux:

Thank you, Antoine. This is an expected result.

> And the join() approach is 10x faster (!):
> C:\t\cpython>pc\VS9.0\amd64\python.exe -m timeit -s "import io; n=2000; 
> d=[b'a'*
> n,b'bb'*n,b'ccc'*n]*1000"  "b''.join(d)"
> 100 loops, best of 3: 4.63 msec per loop

To be fair, test body should be: "s=[]; w=s.append"  "for x in d: w(x)"  
"b''.join(s)"

May be tuning resize strategy (overallocate not 1/8, but 1/4, 1/2, or 100%) can 
help.

--

___
Python tracker 

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

> There seems to be a problem with the patch: when you store the getvalue() 
> result somewhere (instead of discarding it), things get much slower:

This problem exists with the new patch?

--

___
Python tracker 

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-20 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


Removed file: http://bugs.python.org/file26429/bytesio_resized_bytes.patch

___
Python tracker 

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-20 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

The patch updated. Fixed some errors, optimized initialization, added checks 
and comments. I think that now the patch is ready for review.

--
Added file: http://bugs.python.org/file26461/bytesio_resized_bytes-2.patch

___
Python tracker 

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



[issue15168] Move importlib.test to test.importlib

2012-07-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset f1f480650a0a by Ned Deily in branch 'default':
Issue #15168: Ensure test_importlib subdirectories are installed.
http://hg.python.org/cpython/rev/f1f480650a0a

--

___
Python tracker 

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



[issue15168] Move importlib.test to test.importlib

2012-07-20 Thread Brett Cannon

Brett Cannon  added the comment:

Fixed by e5c34fe087ef and e2787e926969

--
status: open -> closed

___
Python tracker 

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



[issue15168] Move importlib.test to test.importlib

2012-07-20 Thread R. David Murray

R. David Murray  added the comment:

Looks like this broke the buildbots.

--
nosy: +r.david.murray
status: closed -> open

___
Python tracker 

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



[issue15409] Deprecation Warning fix on cookiejar module

2012-07-20 Thread Meador Inge

Meador Inge  added the comment:

I already added you to ACKS with the ctypes patch :-)

http://hg.python.org/cpython/rev/f93efd4c45bd

--

___
Python tracker 

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



[issue15409] Deprecation Warning fix on cookiejar module

2012-07-20 Thread Flávio Ribeiro

Flávio Ribeiro  added the comment:

nice Meador :-) 

Already sent the form to contribut...@python.org. Added also one diff to 
Misc/ACKS, it's up to you add it or not.

Thanks

--
Added file: http://bugs.python.org/file26460/add_flavioribeiro_acks.patch

___
Python tracker 

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



[issue15409] Deprecation Warning fix on cookiejar module

2012-07-20 Thread Meador Inge

Meador Inge  added the comment:

This looks OK to me.  I will commit later today.

--
assignee:  -> meador.inge
components: +Library (Lib) -Extension Modules
stage:  -> commit review
type:  -> behavior

___
Python tracker 

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



[issue15168] Move importlib.test to test.importlib

2012-07-20 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon
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



[issue9736] doctest.DocTestSuite doesn't handle test globs correctly

2012-07-20 Thread Hugo Lopes Tavares

Hugo Lopes Tavares  added the comment:

I see the bug was not fixed yet, and I started to investigate it.

I am attaching a test patch. I don't know if I will get it working soon, since 
I see it as a very low priority for Python.

--
keywords: +patch
nosy: +hltbra
versions: +Python 3.3, Python 3.4 -Python 3.1, Python 3.2
Added file: http://bugs.python.org/file26459/issue9736_doctestsuite_test.patch

___
Python tracker 

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



[issue15163] pydoc displays __loader__ as module data

2012-07-20 Thread Éric Araujo

Éric Araujo  added the comment:

I have internet problems at home and am not set up to work on Python at work, 
so feel free to commit the patch.

--

___
Python tracker 

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



[issue15168] Move importlib.test to test.importlib

2012-07-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4cebcfc97774 by Brett Cannon in branch 'default':
Issue #15168: Move importlb.test to test.test_importlib.
http://hg.python.org/cpython/rev/4cebcfc97774

--
nosy: +python-dev

___
Python tracker 

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



[issue15010] unittest: _top_level_dir is incorrectly persisted between calls to different load_test methods

2012-07-20 Thread Igor Sobreira

Igor Sobreira  added the comment:

Updated patch to restore previous value of ._top_level_dir on discover() done. 
And added a unit test.

--
Added file: 
http://bugs.python.org/file26458/restore_top_level_dir_to_previous_value.patch

___
Python tracker 

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



[issue3367] Uninitialized value read in parsetok.c

2012-07-20 Thread Stefan Krah

Stefan Krah  added the comment:

I think the original issue in parsetok.c is still present. The
fix that was committed was for sys_update_path().

--

___
Python tracker 

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



[issue9914] trace/profile conflict with the use of sys.modules[__name__]

2012-07-20 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue15091] ImportError when package is symlinked on Unix

2012-07-20 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> brett.cannon
resolution:  -> 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



[issue15091] ImportError when package is symlinked on Unix

2012-07-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 721b701feb4a by Brett Cannon in branch 'default':
Issue #15091: Call importlib.invalidate_caches() and reactivate a test
http://hg.python.org/cpython/rev/721b701feb4a

--

___
Python tracker 

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



[issue15408] os.fork/os.popen behaviour change between 2.7 and 3.2

2012-07-20 Thread Richard Oudkerk

Richard Oudkerk  added the comment:

Actually, if you replace

print(os.popen("uname").read())

with

f = os.popen("uname")
print(f.read())
f.close()

or

with os.popen("uname") as f:
print(f.read())

then things should work.  This is because f.close() waits for the pid.

--

___
Python tracker 

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



[issue15406] Deprecation Warning fix on ctypes module test

2012-07-20 Thread Meador Inge

Meador Inge  added the comment:

Thanks again for the patch Flávio.  Please contribute again to Python (be sure 
to fill out a contributor agreement if you do: 
http://www.python.org/psf/contrib/).

--
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
versions: +Python 3.2

___
Python tracker 

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



[issue15409] Deprecation Warning fix on cookiejar module

2012-07-20 Thread Flávio Ribeiro

Changes by Flávio Ribeiro :


--
nosy: +meador.inge

___
Python tracker 

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



[issue14895] test_warnings.py EnvironmentVariableTests is a bad test

2012-07-20 Thread Brett Cannon

Brett Cannon  added the comment:

Phil said it's Jython's problem, so I won't worry about this on CPython's side.

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

___
Python tracker 

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



[issue15406] Deprecation Warning fix on ctypes module test

2012-07-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset fb181698775d by Meador Inge in branch '3.2':
Issue #15406: Fix deprecation warning in ctypes test_bitfields.py
http://hg.python.org/cpython/rev/fb181698775d

New changeset f93efd4c45bd by Meador Inge in branch 'default':
Issue #15406: Fix deprecation warning in ctypes test_bitfields.py
http://hg.python.org/cpython/rev/f93efd4c45bd

--
nosy: +python-dev

___
Python tracker 

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



[issue3367] Uninitialized value read in parsetok.c

2012-07-20 Thread Brett Cannon

Brett Cannon  added the comment:

Should this be closed?

--

___
Python tracker 

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



[issue1644818] Allow built-in packages and submodules as well as top-level modules

2012-07-20 Thread Brett Cannon

Changes by Brett Cannon :


--
versions: +Python 3.4 -Python 3.3

___
Python tracker 

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



[issue665194] datetime-RFC2822 roundtripping

2012-07-20 Thread Brett Cannon

Changes by Brett Cannon :


--
nosy:  -brett.cannon

___
Python tracker 

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



[issue2919] Merge profile/cProfile in 3.n+1

2012-07-20 Thread Brett Cannon

Brett Cannon  added the comment:

So I didn't find time at EuroPython. =) Is this dead, Alexandre, or do you want 
to see this happen for Python 3.4?

--

___
Python tracker 

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




[issue15292] import hook behavior documentation improvement

2012-07-20 Thread Brett Cannon

Brett Cannon  added the comment:

So I can't reproduce the problem under Python 2.7.3, Python 3.2.3, or a fresh 
checkout of Python 3.3. This is with both your script, Anders, and writing my 
own class that defined find_module() to just raise ImportError that I set in 
either sys.meta_path or in sys.path_importer_cache (both ways let the 
ImportError propagate).

This means I'm not sure exactly what problem you are encountering. Is this on 
an older version of Python 2.7? Do you have a unit test that can be run  which 
shows the test failing under Python 2.7 but passing under Python 3.3?

--
status: open -> pending

___
Python tracker 

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



[issue15409] Deprecation Warning fix on cookiejar module

2012-07-20 Thread Flávio Ribeiro

New submission from Flávio Ribeiro :

Cookiejar calls some urllib.Request's deprecated methods. This patch fixes this 
deprecated calls.

--
components: Extension Modules
files: cookiejar_fix_deprecated_method_calls.patch
keywords: patch
messages: 165956
nosy: flavio.ribeiro
priority: normal
severity: normal
status: open
title: Deprecation Warning fix on cookiejar module
versions: Python 3.3
Added file: 
http://bugs.python.org/file26457/cookiejar_fix_deprecated_method_calls.patch

___
Python tracker 

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



[issue15163] pydoc displays __loader__ as module data

2012-07-20 Thread Brett Cannon

Changes by Brett Cannon :


--
assignee:  -> eric.araujo
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



[issue15408] os.fork/os.popen behaviour change between 2.7 and 3.2

2012-07-20 Thread Richard Oudkerk

Richard Oudkerk  added the comment:

The problem is that os.wait() is returning when the wrong process exits.

You can fix this by specifying the pid you are waiting for by doing 
"os.waitpid(pid, 0)" instead of "os.wait()".

Arguably os.popen() and subprocess.communicate() etc should always reap the pid 
of the process they started.

--
nosy: +sbt

___
Python tracker 

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



[issue15010] unittest: _top_level_dir is incorrectly persisted between calls to different load_test methods

2012-07-20 Thread Igor Sobreira

Igor Sobreira  added the comment:

My previous patch is incorrect, talking to voidspace on irc self._top_leve_dir 
should be reverted to it's previous value

"so when discover is called the original value should be stored, then discovery 
done, and then the original restored"

I'll work on this one.

He also pointed out that this bugfix should be backported to 2.7 and 3.2

--

___
Python tracker 

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



[issue15272] pkgutil.find_loader accepts invalid module names

2012-07-20 Thread Brett Cannon

Brett Cannon  added the comment:

PEP 302 just says that find_module "will be called with the fully qualified 
name of the module." And importation by file name was removed in Python 3 (at 
some point; don't remember exact feature release). So supporting slashes in a 
module name is probably not necessary anymore.

--

___
Python tracker 

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



[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2012-07-20 Thread Chris Rebert

Changes by Chris Rebert :


--
nosy: +cvrebert

___
Python tracker 

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



[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread Cal Leeming

Cal Leeming  added the comment:

@david Gotcha - I had a feeling that would be the case. Thank you for the quick 
replies anyway guys! Hopefully this will help others in the future :)

--

___
Python tracker 

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



[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread R. David Murray

R. David Murray  added the comment:

We don't generally do that kind of type checking.

--
nosy: +r.david.murray
resolution:  -> invalid
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



[issue15406] Deprecation Warning fix on ctypes module test

2012-07-20 Thread Meador Inge

Meador Inge  added the comment:

Thanks for the patch.  I will review it shortly.

--
assignee:  -> meador.inge
components: +ctypes
nosy: +meador.inge
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue15406] Deprecation Warning fix on ctypes module test

2012-07-20 Thread Flávio Ribeiro

Changes by Flávio Ribeiro :


--
title: Deprecation Warning fix on ctypes module -> Deprecation Warning fix on 
ctypes module test

___
Python tracker 

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



[issue15406] Deprecation Warning fix on ctypes module

2012-07-20 Thread Flávio Ribeiro

Flávio Ribeiro  added the comment:

One issue per module will be created to facilitate the issues management.

--
title: Deprecation Warnings fixes on test suite -> Deprecation Warning fix on 
ctypes module

___
Python tracker 

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



[issue15397] Unbinding of methods

2012-07-20 Thread Richard Oudkerk

Richard Oudkerk  added the comment:

Can't you unbind without any changes to the C code by doing

def unbind(f):
if hasattr(f, '__func__'):
return f.__func__
self = getattr(f, '__self__', None)
if self is not None and not isinstance(self, types.ModuleType):
return getattr(type(f.__self__), f.__name__)
raise TypeError('not a bound method')

Also, I am not convinced that it is a good idea to return f if f is already 
"unbound".  In practice I think you will always need to treat the bound and the 
unbound cases differently.

--
nosy: +sbt

___
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-07-20 Thread Chris Rebert

Chris Rebert  added the comment:

Pinging on this, since it's been just short of a month since Éric's "last call" 
comment.

--

___
Python tracker 

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



[issue15363] Idle/tkinter ~x.py 'save as' fails. closes idle

2012-07-20 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue15402] Correct __sizeof__ support for struct

2012-07-20 Thread Gregory P. Smith

Gregory P. Smith  added the comment:

makes sense for 3.3 as i would consider it a bug.

i think it is reasonable for 2.7 and 3.2 as well, it is an actual bug that the 
value reported to getsizeof on struct.Struct is meaningless.

--
nosy: +gregory.p.smith

___
Python tracker 

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



[issue15402] Correct __sizeof__ support for struct

2012-07-20 Thread Jesús Cea Avión

Jesús Cea Avión  added the comment:

The patch is easy. I want this in 3.3.

Reluctant to touch 2.7 and 3.2, thought. I would be +0 to it.

--

___
Python tracker 

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



[issue15359] Sockets support for CAN_BCM

2012-07-20 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



[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread Tim Golden

Tim Golden  added the comment:

It already produces a TypeError with a specific message if the input is
not iterable. You seem to be using a homegrown dialect; with the
conventional list (csv.reader("the quick brown fox")) you very quickly
see that you're iterating over a string.

--
nosy: +tim.golden

___
Python tracker 

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



[issue15038] Optimize python Locks on Windows

2012-07-20 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

Thanks, Benjamin.  That's what reviews are for :)

--

___
Python tracker 

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



[issue15408] os.fork/os.popen behaviour change between 2.7 and 3.2

2012-07-20 Thread Walter Dörwald

New submission from Walter Dörwald :

The attached script behaves differently on Python 2.7.2 and Python 3.2.3.

With Python 2.7 the script runs for ca. 30 seconds and then I get back my 
prompt.

With Python 3.2 the script runs in the background, I get back my prompt 
immediately and can type shell commands.

Commenting out the call to uname() changes the behaviour of the script on 
Python 3.2 so that it behaves like on Python 2.7.

(This happens on both Max OS X 10.7 and Linux.)

--
files: gurk.py
messages: 165942
nosy: doerwalter
priority: normal
severity: normal
status: open
title: os.fork/os.popen behaviour change between 2.7 and 3.2
versions: Python 3.2
Added file: http://bugs.python.org/file26456/gurk.py

___
Python tracker 

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



[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread Cal Leeming

Cal Leeming  added the comment:

Okay, just found the reason for this.. It's because I was putting a .read() on 
the file descriptor..

I really think that the CSVReader should raise an assertion in the event that 
it is passed an object which has no iterator, or if it is given a string, as 
this is a fairly easy mistake to make.

--

___
Python tracker 

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



[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread Cal Leeming

Cal Leeming  added the comment:

This bug also seems to be showing in 2.7.3

--

___
Python tracker 

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



[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread Cal Leeming

Cal Leeming  added the comment:

Sorry, accidently pasted the wrong code snippet previously. The correct code 
snippet is:

datx = open("data.txt", "rb").read()
rows = csv.reader( datx )
for row in rows:
print x

--

___
Python tracker 

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



[issue15407] CSV parser fails to iterate properly on 2.6.6

2012-07-20 Thread Cal Leeming

New submission from Cal Leeming :

Getting some extremely strange behavior when attempting to parse a fairly 
standard CSV in Python 2.6.6.

I've tried a whole different mixture of dialects, quoting options, line 
terminators etc, and none seem to get a happy ending.

Spent about 2 hours banging my head against a brick wall on this, and 
struggling to see how the CSV libs could be so fundamentally broken, given that 
I couldn't find any other related bugs.

I have attempted to parse the following CSV data:

"First","Middle","Last","Nickname","Email","Category"
"Moe","","Howard","Moe","m...@3stooges.com","actor"
"Jerome","Lester","Howard","Curly","cu...@3stooges.com","actor"
"Larry","","Fine","Larry","la...@3stooges.com","musician"
"Jerome","","Besser","Joe","j...@3stooges.com","actor"
"Joe","","DeRita","CurlyJoe","curly...@3stooges.com","actor"
"Shemp","","Howard","Shemp","sh...@3stooges.com","actor"

The code used to parse was this:

datx = open("data.txt", "rb").read()
rows = csv.reader( datx , dialect="wat")
for row in rows:
print x

The output given is this:

['First']
['', '']
['Middle']
['', '']
['Last']
['', '']
['Nickname']
['', '']
['Email']
['', '']
['Category']
[]
['Moe']
['', '']
['']
['', '']
['Howard']
['', '']
['Moe']
['', '']
['m...@3stooges.com']
['', '']
['actor']
[]
['Jerome']
['', '']
['Lester']
['', '']
['Howard']
['', '']
['Curly']
['', '']
['cu...@3stooges.com']
['', '']
['actor']
[]
['Larry']
['', '']
['']
['', '']
['Fine']
['', '']
['Larry']
['', '']
['la...@3stooges.com']
['', '']
['musician']
[]
['Jerome']
['', '']
['']
['', '']
['Besser']
['', '']
['Joe']
['', '']
['j...@3stooges.com']
['', '']
['actor']
[]
['Joe']
['', '']
['']
['', '']
['DeRita']
['', '']
['CurlyJoe']
['', '']
['curly...@3stooges.com']
['', '']
['actor']
[]
['Shemp']
['', '']
['']
['', '']
['Howard']
['', '']
['Shemp']
['', '']
['sh...@3stooges.com']
['', '']
['actor']
[]

--
components: None
messages: 165938
nosy: sleepycal
priority: normal
severity: normal
status: open
title: CSV parser fails to iterate properly on 2.6.6
versions: Python 2.6

___
Python tracker 

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Under Windows (64-bit Windows 7 on a  VirtualBox VM), the patch increases 
performance slightly but not as much as under Linux:

-> before patch:

C:\t\cpython>pc\VS9.0\amd64\python.exe -m timeit -s "import io; n=2000; d=[b'a'*
n,b'bb'*n,b'ccc'*n]*1000"  "s=io.BytesIO(); w=s.write"  "for x in d: w(x)"  "s.g
etvalue()"
10 loops, best of 3: 49.2 msec per loop

-> after patch:

C:\t\cpython>pc\VS9.0\amd64\python.exe -m timeit -s "import io; n=2000; d=[b'a'*
n,b'bb'*n,b'ccc'*n]*1000"  "s=io.BytesIO(); w=s.write"  "for x in d: w(x)"  "s.g
etvalue()"
10 loops, best of 3: 41.7 msec per loop


And the join() approach is 10x faster (!):

C:\t\cpython>pc\VS9.0\amd64\python.exe -m timeit -s "import io; n=2000; d=[b'a'*
n,b'bb'*n,b'ccc'*n]*1000"  "b''.join(d)"
100 loops, best of 3: 4.63 msec per loop

... which points to a much less optimized realloc() under Windows.

--

___
Python tracker 

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



[issue15402] Correct __sizeof__ support for struct

2012-07-20 Thread Meador Inge

Meador Inge  added the comment:

Module a few cosmetic changes (variable names and doc string tweaks), the patch 
looks good.  Having a correct answer for `sys.getsizeof(struct.Struct('100B'))` 
is definitely better.  Per the documentation for 'sys.getsizeof' [1]:

"""
All built-in objects will return correct results, but this does not have to 
hold true for third-party extensions as it is implementation specific.
"""

If we consider extension modules as built-in objects, then this is a bug and 
should be fixed in 2.7, 3.2, and 3.3.  If we don't, then the documentation for 
'sys.getsizeof' should be adjusted and this patch should be applied after the 
default branch is unfrozen for enhancements.

[1] http://docs.python.org/library/sys.html

--
stage:  -> patch review

___
Python tracker 

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



[issue15381] Optimize BytesIO to so less reallocations when written, similarly to StringIO

2012-07-20 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

There seems to be a problem with the patch: when you store the getvalue() 
result somewhere (instead of discarding it), things get much slower:

$ ./python -m timeit -s "import io; n=2000; d=[b'a'*n,b'bb'*n,b'ccc'*n]*1000"  
"s=io.BytesIO(); w=s.write"  "for x in d: w(x)"  "s.getvalue()"
1000 loops, best of 3: 913 usec per loop

$ ./python -m timeit -s "import io; n=2000; d=[b'a'*n,b'bb'*n,b'ccc'*n]*1000"  
"s=io.BytesIO(); w=s.write"  "for x in d: w(x)"  "global y; y = s.getvalue()"
100 loops, best of 3: 4.67 msec per loop

This does not happen without the patch.

--

___
Python tracker 

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



[issue15406] Deprecation Warnings fixes on test suite

2012-07-20 Thread Hynek Schlawack

Changes by Hynek Schlawack :


--
nosy: +hynek

___
Python tracker 

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



[issue15406] Deprecation Warnings fixes on test suite

2012-07-20 Thread Flávio Ribeiro

Flávio Ribeiro  added the comment:

The patch remove this warning:

$ ./python.exe -Wm -m test test_ctypes
[1/1] test_ctypes
/Users/flavio.barbosa/dev/cpython/Lib/ctypes/test/test_bitfields.py:249: 
DeprecationWarning: Please use assertEqual instead.
  self.assertEquals(x.a, 10)
1 test OK.
[155770 refs]

--
keywords: +patch
Added file: http://bugs.python.org/file26455/issue15406_fix_ctypes_warnings.diff

___
Python tracker 

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



[issue15406] Deprecation Warnings fixes on test suite

2012-07-20 Thread Flávio Ribeiro

New submission from Flávio Ribeiro :

Looking for bugs to be solved on a cPython Sprint, Hynek reported at 
core-mentorship list some Deprecation Warnings running the test suite in 
regression mode. 

This issue aims to solve this warnings.

--
components: Tests
messages: 165933
nosy: flavio.ribeiro
priority: normal
severity: normal
status: open
title: Deprecation Warnings fixes on test suite
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



[issue13592] repr(regex) doesn't include actual regex

2012-07-20 Thread Hugo Lopes Tavares

Hugo Lopes Tavares  added the comment:

Changed two test names to avoid misunderstanding.

--
Added file: 
http://bugs.python.org/file26454/issue13592_add_repr_to_regex_v2_1.patch

___
Python tracker 

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



[issue1675455] Use getaddrinfo() in urllib2.py for IPv6 support

2012-07-20 Thread Ramchandra Apte

Ramchandra Apte  added the comment:

Bump.

--
nosy: +ramchandra.apte

___
Python tracker 

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



[issue13592] repr(regex) doesn't include actual regex

2012-07-20 Thread Hugo Lopes Tavares

Hugo Lopes Tavares  added the comment:

Thanks for the review ezio.melotti.

He has notice a few things in my patch:
* assertEquals is deprecated; should use assertEqual
* the convention is assertEqual(result, expected), not assertEqual(expected, 
result)
* it should handle quotes correctly
* some lines were longer than 80 chars
* add tests using inline flags (re.I instead of re.IGNORECASE)

And I realized I was not covering the case where no flags are enabled (byte 
string, for instance). And I have fixed all this issues.

And now I think this patch would work against py2x and py3k anyway.

Attaching a new patch.

--
Added file: 
http://bugs.python.org/file26453/issue13592_add_repr_to_regex_v2.patch

___
Python tracker 

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



[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2012-07-20 Thread Juarez Bochi

Juarez Bochi  added the comment:

I've updated the patch based on ezio.melotti and berkerpeksag reviews (thanks).

It's still missing the modifications proposed on msg107402.

--
Added file: http://bugs.python.org/file26452/issue1100942_pure2.diff

___
Python tracker 

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



[issue9914] trace/profile conflict with the use of sys.modules[__name__]

2012-07-20 Thread Tatiana Al-Chueyr

Tatiana Al-Chueyr  added the comment:

Yesterday I've studied this problem with flavio.ribeiro, and we've started 
"solving" it. The result of our progress is available at:
issue5758_trace_execute_other_modules_main_v0.patch

The problem of our approach is that any code outside the condition "if __name__ 
== '__main__'" will be run twice, as we used imp.load_source to obtain trace's 
analyzed code and redefine sys.modules['__main__'].

In order to provide a better solution, we were considering using lazy module 
import, e.g:
http://code.activestate.com/recipes/473888-lazy-module-imports/

Any thoughts on this?

--
keywords: +patch
nosy: +tati_alchueyr
Added file: 
http://bugs.python.org/file26451/issue5758_trace_execute_other_modules_main_v0.patch

___
Python tracker 

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



[issue14562] urllib2 maybe blocks too long with small chunks

2012-07-20 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

I had a discussion with Anrs on this, and it went along these lines - 

I confused the buffering issue (encountered with streaming data) of urllib2 
with chunked transfer encoding.

The flow will be blocked in the case at the socket level waiting for 8192 
bytes. But this buffer size has been kept for buffered reading purposes of 
normal read scenarios.
However, in case of streaming data, this may be not the best way.

Here it is explained best - 

http://stackoverflow.com/questions/1598331/how-to-read-continous-http-streaming-data-in-python

The advise is to make the socket buffer size to 0.

import socket

socket._fileobject.default_bufsize = 0

Now, if we come to chunked transfer encoding, the chunked transfer encoding 
will behave as it is advertised, like sending one chunk at the time, but still 
having the readline limit set by MAXLINE in the httplib.py. For the chunked 
transfer encoding to be recognized the client will have to get a header 
"transfer-encoding: chunked" from the server and when it receives that header, 
it will follow the path reading MAXLINE at the time and then returning. For 
smaller chunks with a blocking behavior of the server ( like you illustrated), 
we may still need to adopt to turn off default_bufsize to 0 to ensure quick 
responses to fill the buffer.

At this moment, I think that the above thing could be documented in the urllib2 
docs for the issue you had raised. Not sure, if any other approach would be 
suitable to handle this behavior.

Anrs (The original poster) also responded that they way he had to overcome this 
for a very small chunks is setting the socket file size to 0 locally.

>> resp = opener.open(server, urllib.urlencode(data))
>> resp = opener.open(server)
>> resp.fp._rbufsize = 0
>> for line in iter(resp.readline, ''):
>> yield line

I think, this could be documented in a certain fashion (like support for 
streaming without buffering or transfers for small data sizes without 
buffering).

--
stage:  -> needs patch

___
Python tracker 

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



[issue15398] intermittence on UnicodeFileTests.test_rename at test_pep277 on MacOS X

2012-07-20 Thread Flávio Ribeiro

Flávio Ribeiro  added the comment:

Ronald,

I thought it could be an `atomic` issue by the fact that test_rename transforms 
a filename in tmp and then it change again to the original name. Not being 
atomic, the rename will not finish the executation of the first one (even 
though a return code has been sent) and FileNotFoundError is dispatched. 

Anyway, i've added a time.sleep in the middle of the two lines to assert this 
and no more intermittence could be found. Ideas?

--

___
Python tracker 

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



[issue15400] int('12345L', 10) raises ValueError

2012-07-20 Thread Meador Inge

Meador Inge  added the comment:

Thanks for the analysis Mark.  I agree with your points.

--

___
Python tracker 

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



[issue15386] Still getting two copies of importlib._bootstrap

2012-07-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

That was a *lot* harder than I expected to create a test for - I had to import 
importlib right at the start of regrtest, as well as tweak the import order in 
runpy, and doing so actually caused test_import to *crash* completely without 
the bug fixed.

The trick was realising that *anything* importing imp before importlib would 
mask the bug.

--

___
Python tracker 

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



[issue15091] ImportError when package is symlinked on Unix

2012-07-20 Thread Nick Coghlan

Changes by Nick Coghlan :


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

___
Python tracker 

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



[issue15386] Still getting two copies of importlib._bootstrap

2012-07-20 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 4431dc4bb770 by Nick Coghlan in branch 'default':
Close #15386: There was a loophole that meant importlib.machinery and imp would 
sometimes reference an uninitialised copy of importlib._bootstrap
http://hg.python.org/cpython/rev/4431dc4bb770

--
nosy: +python-dev
resolution:  -> fixed
stage: test needed -> 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



[issue15398] intermittence on UnicodeFileTests.test_rename at test_pep277 on MacOS X

2012-07-20 Thread Rafael Caricio

Rafael Caricio  added the comment:

I had this problem when I run the tests in my machine (Mac OSX 10.6.8). The 
intermittence happen here.

--
nosy: +rafaelcaricio

___
Python tracker 

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



[issue15091] ImportError when package is symlinked on Unix

2012-07-20 Thread Nick Coghlan

Nick Coghlan  added the comment:

Oh, wow, that was a *lot* harder than I expected to create a test for - I had 
to import importlib right at the start of regrtest, as well as tweak the import 
order in runpy, and doing so actually caused test_import to *crash* completely 
without the bug fixed.

The trick was realising that *anything* importing imp before importlib would 
mask the bug.

--

___
Python tracker 

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



[issue15405] Invitation to connect on LinkedIn

2012-07-20 Thread Nadeem Vawda

Changes by Nadeem Vawda :


--
resolution:  -> invalid
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



[issue15405] Invitation to connect on LinkedIn

2012-07-20 Thread reynaldo

New submission from reynaldo :

LinkedIn


Python,

I'd like to add you to my professional network on LinkedIn.

- reynaldo

reynaldo bendijo
owner at www.omickiey.com
Greater Los Angeles Area

Confirm that you know reynaldo bendijo:
https://www.linkedin.com/e/-3qcne3-h4vad8ug-3t/isd/4079929199/bZ2HS2mr/?hs=false&tok=3ElCzFvFARvlk1

--
messages: 165920
nosy: renben
priority: normal
severity: normal
status: open
title: Invitation to connect on LinkedIn

___
Python tracker 

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



[issue15091] ImportError when package is symlinked on Unix

2012-07-20 Thread Nick Coghlan

Changes by Nick Coghlan :


--
priority: normal -> release blocker

___
Python tracker 

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



[issue15091] ImportError when package is symlinked on Unix

2012-07-20 Thread Nick Coghlan

Changes by Nick Coghlan :


--
nosy: +ncoghlan

___
Python tracker 

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



[issue12834] PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-07-20 Thread Stefan Krah

Stefan Krah  added the comment:

> You could move PyBuffer_ToContiguous() from abstract.c to memoryview.c.

For 3.3 that would be ideal, yes. I asked a while ago on python-dev
whether to backport the memoryview rewrite. The general mood was
against it.

So, for 2.7/3.2 I could add all these functions to abstract.c.
But an additional problem is that the whole test infrastructure of
Lib/test/test_buffer.py and Modules/_testbuffer.c would be missing.

--

___
Python tracker 

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



[issue15393] JSONDecoder.raw_decode breaks on leading whitespace

2012-07-20 Thread Antti Laine

Antti Laine  added the comment:

> you are changing the signature of "decode()" and that would be a 
> compatibility problem

I was changing the signature of raw_decode(), by adding a(n almost) private 
keyword. I really don't see how that would affect compatibility.

> you are thinking that "json document" includes the possibility of leading 
> whitespace

Yes. While JSON does not have a real standard to follow, I believe that going 
by the RFC is the best thing to do, and the RFC very clearly states, that 
objects can be surrounded with whitespace.

decode() depends on the functionality of raw_decode(), and its own parameter 
_w. I have no idea why _w is a parameter. It is not used anywhere in CPython, 
and, beginning with an underscore, it shouldn't be used from anywhere else. 
Still it offers the users a possibility to break the behaviour of decode(). If 
it's a performance hack, making the variable being initialized only once, then 
I think it's a very poor one.

Now the patch leaves decode() as it is, and checks for whitespace in 
raw_decode(), which leads to checking for whitespace twice when using decode().

I think that a more extensive cleanup would be in order.

--
Added file: 
http://bugs.python.org/file26450/json-raw-decoder-fix-whitespace.diff

___
Python tracker 

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



[issue12834] PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-07-20 Thread Christian Heimes

Christian Heimes  added the comment:

You could move PyBuffer_ToContiguous() from abstract.c to memoryview.c.

--

___
Python tracker 

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



[issue12834] PyBuffer_ToContiguous() incorrect for non-contiguous arrays

2012-07-20 Thread Stefan Krah

Stefan Krah  added the comment:

The fix would require all of these functions from memoryview.c (3.3):

last_dim_is_contiguous
cmp_structure
copy_base
copy_rec
copy_buffer


How to avoid code duplication? I could move them into abstract.c,
but conceptually they're really just low level buffer interface
functions. Also, they make a lot of assumptions (ndim >= 1,
PyBUF_FULL) that are a little dangerous for a general interface.

--

___
Python tracker 

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



[issue15404] Refleak in PyMethodObject repr

2012-07-20 Thread Andrew Svetlov

Changes by Andrew Svetlov :


--
stage:  -> committed/rejected
type:  -> resource usage

___
Python tracker 

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



  1   2   >