[issue1767933] Badly formed XML using etree and utf-16

2012-07-15 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Thank you, Eli.

However changes to tostring() and tostringlist() break the invariant 
b.join(tostringlist(element, 'utf-16')) == tostring(element, 'utf-16'). You 
should add followed methods to DataStream:

def seekable(self):
return True

def tell(self):
return len(data)

Note, that monkey-patched version is faster.

stream = io.BufferedIOBase()
stream.writable = lambda: True
stream.write = data.append
stream.seekable = lambda: True
stream.tell = data.__len__

Benchmark results:

tostring() with BytesIO:
$ ./python -m timeit -s import xml.etree.ElementTree as ET; 
e=ET.XML('root/')  ET.tostring(e, 'utf-16')
1000 loops, best of 3: 268 usec per loop
$ ./python -m timeit -s import xml.etree.ElementTree as ET; 
e=ET.XML('root'+'child/'*100+'/root' )  ET.tostring(e, 'utf-16')
100 loops, best of 3: 4.63 msec per loop

tostring() with monkey-patching:
$ ./python -m timeit -s import xml.etree.ElementTree as ET; 
e=ET.XML('root/')  ET.tostring(e, 'utf-16')
1000 loops, best of 3: 263 usec per loop
$ ./python -m timeit -s import xml.etree.ElementTree as ET; 
e=ET.XML('root'+'child/'*100+'/root' )  ET.tostring(e, 'utf-16')
100 loops, best of 3: 3.84 msec per loop

tostringlist() with DataStream class:
$ ./python -m timeit -s import xml.etree.ElementTree as ET; 
e=ET.XML('root/')  ET.tostringlist(e, 'utf-16')
1000 loops, best of 3: 624 usec per loop
$ ./python -m timeit -s import xml.etree.ElementTree as ET; 
e=ET.XML('root'+'child/'*100+'/root' )  ET.tostringlist(e, 'utf-16')
100 loops, best of 3: 4.09 msec per loop

tostringlist() with monkey-patching:
$ ./python -m timeit -s import xml.etree.ElementTree as ET; 
e=ET.XML('root/')  ET.tostringlist(e, 'utf-16')1000 loops, best of 3: 259 
usec per loop
$ ./python -m timeit -s import xml.etree.ElementTree as ET; 
e=ET.XML('root'+'child/'*100+'/root' )  ET.tostringlist(e, 'utf-16')
100 loops, best of 3: 3.81 msec per loop

--

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



[issue1470548] Bugfix for #1470540 (XMLGenerator cannot output UTF-16)

2012-07-15 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Here is updated patch with more careful handling of closing (as for 
issue1767933) and added comments.

--
nosy: +eli.bendersky
Added file: http://bugs.python.org/file26385/XMLGenerator-3.patch

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



[issue4997] xml.sax.saxutils.XMLGenerator should write to io.RawIOBase.

2012-07-15 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

This issue will be fixed by patch for issue1470548.

--
nosy: +storchaka

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



[issue15357] Deprecate redundant pieces of pkgutil

2012-07-15 Thread Roundup Robot

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

New changeset 3987667bf98f by Nick Coghlan in branch 'default':
Take the first step in resolving the messy pkgutil vs importlib edge cases by 
basing pkgutil explicitly on importlib, deprecating its internal import 
emulation and setting __main__.__loader__ correctly so that runpy still works 
(Affects #15343, #15314, #15357)
http://hg.python.org/cpython/rev/3987667bf98f

--
nosy: +python-dev

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



[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-15 Thread Roundup Robot

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

New changeset 3987667bf98f by Nick Coghlan in branch 'default':
Take the first step in resolving the messy pkgutil vs importlib edge cases by 
basing pkgutil explicitly on importlib, deprecating its internal import 
emulation and setting __main__.__loader__ correctly so that runpy still works 
(Affects #15343, #15314, #15357)
http://hg.python.org/cpython/rev/3987667bf98f

--
nosy: +python-dev

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



[issue15314] Use importlib instead of pkgutil in runpy

2012-07-15 Thread Roundup Robot

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

New changeset 3987667bf98f by Nick Coghlan in branch 'default':
Take the first step in resolving the messy pkgutil vs importlib edge cases by 
basing pkgutil explicitly on importlib, deprecating its internal import 
emulation and setting __main__.__loader__ correctly so that runpy still works 
(Affects #15343, #15314, #15357)
http://hg.python.org/cpython/rev/3987667bf98f

--
nosy: +python-dev

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



[issue15314] Use importlib instead of pkgutil in runpy

2012-07-15 Thread Nick Coghlan

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

OK, I think runpy and __main__.__loader__ are all sorted now. The relevant 
runpy and command line script tests all check for the expected values, and I 
added a couple of new tests to cover the -c and reading from stdin cases.

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

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15314
___
___
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-15 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
assignee:  - ncoghlan

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15272
___
___
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-15 Thread Nick Coghlan

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

OK, this one is trickier than I thought - the exact behaviour depends on how 
you traverse the code, and I believe a PEP 302 importer is technically allowed 
to accept / in module names. (Unless there's a module names must be valid 
identifiers in there somewhere that I have forgotten about)

Punting on it for the moment.

--
assignee: ncoghlan - 

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



[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-15 Thread Nick Coghlan

New submission from Nick Coghlan ncogh...@gmail.com:

Created to record the egregious hack of relying on the test_runpy 
infrastructure in order to test pkgutil.walk_packages.

It gets the job done, but is a really messy way of going about it. Worth 
cleaning up by factoring the support code out to a helper module when there 
isn't a release deadline looming.

--
components: Tests
messages: 165516
nosy: ncoghlan
priority: low
severity: normal
stage: needs patch
status: open
title: Test pkgutil.walk_packages in test_pkgutil instead of test_runpy
type: enhancement
versions: Python 3.3

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



[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-15 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
dependencies: +pydoc -w package writes out page with empty Package 
Contents section

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



[issue11322] encoding package's normalize_encoding() function is too slow

2012-07-15 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 I don't know who changed the encoding's package normalize_encoding() function 
 (wasn't me), but it's a really slow implementation.

See changeset 54ef645d08e4.

--
nosy: +storchaka

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



[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-15 Thread Roundup Robot

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

New changeset 9101eab6178c by Nick Coghlan in branch 'default':
Issue #15343: Handle importlib.machinery.FileFinder instances in 
pkgutil.walk_packages (et al)
http://hg.python.org/cpython/rev/9101eab6178c

--

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



[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-15 Thread Nick Coghlan

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

Also, a second test case should be added to cover the zipimporter.zipimporter 
component.

--

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



[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-15 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
priority: low - normal

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



[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-15 Thread Nick Coghlan

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

Fixing this has uncovered another issue: the old import emulation in PEP 302 
ignored encoding cookies, thus merrily decoding everything as utf-8 in 
get_source(). importlib is smarter about this, which means the pydoc tests 
started failing as they tried to load the files with invalid encoding cookies.

I plan to tackle this in two parts:

- move get_source() and get_code() in importlib towards consistently raising 
ImportError, regardless of the reason the result couldn't be provided (chaining 
the exceptions to ensure details aren't lost)

- update pydoc to tolerate ImportError from get_source.

--

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



[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-15 Thread Roundup Robot

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

New changeset 7d202353a728 by Nick Coghlan in branch 'default':
Issue #15343: A lot more than just unicode decoding can go wrong when 
retrieving a source file
http://hg.python.org/cpython/rev/7d202353a728

--

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



[issue9319] imp.find_module('test/badsyntax_pep3120') causes segfault

2012-07-15 Thread Roundup Robot

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

New changeset ce0687a8383b by Nick Coghlan in branch 'default':
Issue #9319: Remove the workaround for this since fixed problem from pydoc
http://hg.python.org/cpython/rev/ce0687a8383b

--

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



[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-15 Thread Nick Coghlan

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

Main change in that last commit is really the one to make pydoc ignore just 
about *any* exception from get_source(). This should make it more robust 
against buggy loaders, too.

--

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



[issue15343] pydoc -w package writes out page with empty Package Contents section

2012-07-15 Thread Nick Coghlan

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

And a manual check confirms the higher level issue is also fixed. (I believe 
there's already a meta issue somewhere about the lack of automated tests for 
pydoc's emitted HTML)

--
resolution:  - fixed
status: open - closed

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



[issue15357] Deprecate redundant pieces of pkgutil

2012-07-15 Thread Nick Coghlan

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

I'm pretty sure I got them all while fixing #15343

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

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



[issue15356] '\xa0' isspace returns true while compiling python on solaris 10 by users using gcc 3.4.6

2012-07-15 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

I'm sorry, It looks like you said it was working as you expected in 2.7, and 
you marked it for version 2.6.  So what is the bug that you see in 2.7?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15356
___
___
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-15 Thread Brian Thorne

New submission from Brian Thorne hardb...@gmail.com:

In addition to CAN_RAW introduced in Python 3.3, it would be really useful to 
expose the CAN_BCM protocol. Effectively it hands off as much  to the kernel as 
possible which gives Python programs the ability to send and receive many 
periodic messages with little additional jitter or overhead.

I've attached an early stab at a patch to see if there is interest.

I'll be putting more examples of using BCM sockets at 
https://bitbucket.org/hardbyte/python-socket-examples

--
components: Library (Lib)
files: python_bcm.patch
keywords: patch
messages: 165527
nosy: Thorney, pitrou
priority: normal
severity: normal
status: open
title: Sockets support for CAN_BCM
type: enhancement
versions: Python 3.4
Added file: http://bugs.python.org/file26386/python_bcm.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15359
___
___
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-15 Thread Antoine Pitrou

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


--
nosy: +neologix

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



[issue15356] '\xa0' isspace returns true while compiling python on solaris 10 by users using gcc 3.4.6

2012-07-15 Thread zoupl

zoupl zoupen...@gmail.com added the comment:

No, i mean it works ok on version 2.7. However, what I want to know is the way 
that works in version2.7, because I want to try to fix it in version 2.6.

--

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



[issue15180] Cryptic traceback from os.path.join when mixing str bytes

2012-07-15 Thread Roundup Robot

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

New changeset cf1ac0c9e753 by Hynek Schlawack in branch '3.2':
#15180: Clarify posixpath.join() error message when mixing str  bytes
http://hg.python.org/cpython/rev/cf1ac0c9e753

New changeset 1462b963e5ce by Hynek Schlawack in branch 'default':
#15180: Clarify posixpath.join() error message when mixing str  bytes
http://hg.python.org/cpython/rev/1462b963e5ce

--
nosy: +python-dev

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



[issue15180] Cryptic traceback from os.path.join when mixing str bytes

2012-07-15 Thread Hynek Schlawack

Hynek Schlawack h...@ox.cx added the comment:

Fixed for 3.2  default.

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

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



[issue15307] Patch for --symlink support in pyvenv with framework python

2012-07-15 Thread Roundup Robot

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

New changeset f954ee489896 by Vinay Sajip in branch 'default':
Issue #15307: Skipped test_venv:test_prefixes when run from a venv.
http://hg.python.org/cpython/rev/f954ee489896

--
nosy: +python-dev

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



[issue15356] '\xa0' isspace returns true while compiling python on solaris 10 by users using gcc 3.4.6

2012-07-15 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Ah.  I have no idea.  I did a search and could not find an issue about it being 
fixed...that doesn't mean there wasn't one, though.

Does the problem occur *only* solaris?  Because if it isn't solaris specific it 
might be this one: issue 1571184.

--

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



[issue15349] SyntaxError b0rked grammar

2012-07-15 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

Thank you for the bug report, Ztatik.

Since 2.6 is now in security-fix-only mode, this issue will not be fixed. See 
http://www.python.org/getit/releases/2.6.8/

This grammar issue was fixed in 2.7 with revision 386922b629c3, but was not 
applied to the 2.6 series at the time.

If you find any more errors, please report them.

--
nosy: +serwy
resolution:  - wont fix
status: open - closed

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



[issue15351] Add to unittest.TestCase support for using context managers

2012-07-15 Thread Michael Foord

Michael Foord mich...@voidspace.org.uk added the comment:

A method on TestCase that *just* executes the test method - allowing for 
overriding in subclasses - is an interesting idea. Including setUp and tearDown 
would be harder because TestCase necessarily does a bunch of bookkeeping 
between each of these steps.

--

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



[issue15202] followlinks/follow_symlinks/symlinks flags unification

2012-07-15 Thread Antoine Pitrou

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

 The .4 patches both LGTM, please commit!

You're the one with commit rights here ;)

--

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



[issue15233] atexit: guarantee order of execution of registered functions?

2012-07-15 Thread Antoine Pitrou

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

 Shall I also backport to 2.7 and 3.2 as the issue suggests?

If the tests are there, yes!

--

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



[issue14787] pkgutil.walk_packages returns extra modules

2012-07-15 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

For the record, this issue is still present after Nick's pkgutil changes 
documented in issue 15343 (not that I expected it to be resolved since this 
issue is a bit different).

--

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



[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-15 Thread Chris Jerdonek

Changes by Chris Jerdonek chris.jerdo...@gmail.com:


--
nosy: +cjerdonek

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15358
___
___
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-15 Thread Davide Rizzo

New submission from Davide Rizzo sor...@gmail.com:

The documentation (at least the obvious places, see 
Doc/reference/datamodel.rst) says classes and class instances have the 
'__dict__' attribute, but nothing is said about what happens when assigning to 
it (like obj.__dict__ = something).

As far as I understand that's undefined behavior and other implementations may 
not work the same as CPython (and CPython itself behaves differently between 
versions).

I'd submit a documentation patch if I knew how to specify this matter. Maybe 
just say the behavior is not defined?

--
assignee: docs@python
components: Documentation, Interpreter Core
messages: 165538
nosy: davide.rizzo, docs@python
priority: normal
severity: normal
status: open
title: Behavior of assigning to __dict__ is not documented
versions: Python 2.7, Python 3.3, Python 3.4

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



[issue15297] pkgutil.iter_importers() includes an ImpImporter

2012-07-15 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

Closing as this is no longer an issue after Nick's pkgutil changes documented 
in issue 15343.

--
status: open - closed

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



[issue15358] Test pkgutil.walk_packages in test_pkgutil instead of test_runpy

2012-07-15 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

Such helper functionality could also be used in the tests of 
unittest.TestLoader.loadTestsFromName().  See, for example, the tests proposed 
for issue 7559.

--

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



[issue8229] Interpreter crash on application shutdown

2012-07-15 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

tb220, is this still a bug? Python 2.6 is now in security-fix-only mode.

--
nosy: +serwy
status: open - pending

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



[issue15202] followlinks/follow_symlinks/symlinks flags unification

2012-07-15 Thread Roundup Robot

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

New changeset 758a9023d836 by Larry Hastings in branch 'default':
Issue #15202: Consistently use the name follow_symlinks for
http://hg.python.org/cpython/rev/758a9023d836

--
nosy: +python-dev

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



[issue14988] _elementtree: Raise ImportError when importing of pyexpat fails

2012-07-15 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com added the comment:

IMHO wrong exception could be treated as a bug, which could be fixed in 3.2 and 
3.3.
Benjamin Peterson and Georg Brandl: What do you think?

 P.S. is there any way to create a test for it?

You can set sys.modules[pyexpat]=None and test exception type when trying to 
import _elementtree.

--
nosy: +benjamin.peterson, georg.brandl

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



[issue15352] importlib.h should be regenerated when the marshaling code changes

2012-07-15 Thread Meador Inge

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

Eric, that is a good point, but if someone forgets (like I did) or just hasn't 
gotten around to bumping the number yet, then the build breaks because the 
interpreter crashes.  I think we should always try to avoid building an 
interpreter that is in an inconsistent state.

Anyway, I am hitting another problem now -- _freeze_importlib is *not* 
idempotent.  Thus adding this rule might cause some noise in the builds because 
importlib.h is different when nothing has actually changed.  I am still 
investigating that problem.

Assuming I can fix the idempotency problem, then maybe _freeze_importlib should 
just be always run.

--

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



[issue15361] venv's Activate.ps1 causes broken prompt with powershell

2012-07-15 Thread Richard Oudkerk

New submission from Richard Oudkerk shibt...@gmail.com:

If I create a venv on Windows called py3 then py3/Scripts/Activate.ps1 
defines the prompt to be

function prompt {
Write-Host -NoNewline -ForegroundColor Green [(py3) ]
_OLD_VIRTUAL_PROMPT
}

However this prompt function does not work properly, and running

Write-Host -NoNewline -ForegroundColor Green [(py3) ]

on its own produces an error because of the lack of quotes around (py3).  
Adding quotes as shown in the patch seems to fix the problem.

--
components: Library (Lib)
files: prompt.patch
keywords: patch
messages: 165545
nosy: sbt, vinay.sajip
priority: normal
severity: normal
stage: patch review
status: open
title: venv's Activate.ps1 causes broken prompt with powershell
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file26387/prompt.patch

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



[issue9374] urlparse should parse query and fragment for arbitrary schemes

2012-07-15 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Removing the module attributes causes third-party code to break.  See one 
example here: 
http://lists.idyll.org/pipermail/testing-in-python/2012-July/005082.html

--
status: closed - open

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



[issue9374] urlparse should parse query and fragment for arbitrary schemes

2012-07-15 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Better link: https://github.com/pypa/pip/issues/552

--

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



[issue15202] followlinks/follow_symlinks/symlinks flags unification

2012-07-15 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

There are versionadded notes in the doc that still use the old names (e.g. 
symlinks for shutil.copyfile).

--
nosy: +eric.araujo

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



[issue15361] venv's Activate.ps1 causes broken prompt with powershell

2012-07-15 Thread Roundup Robot

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

New changeset 0b4d0c2173ad by Vinay Sajip in branch 'default':
Closes #15361: Corrected venv prompt in PowerShell activation script.
http://hg.python.org/cpython/rev/0b4d0c2173ad

--
nosy: +python-dev
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue15362] pyport.h includes antiquated UTF handling for FreeBSD

2012-07-15 Thread John Schneider

New submission from John Schneider j...@jschneider.com:

Revision 36793 introduced a libc wrapper for FreeBSD 5.x which addressed some 
UTF issues. Unfortunately, this causes C compilation errors for certain ports.

Also reference issues 10910, 1455641

This change is no longer applicable for FreeBSD 9.  I'm not sure what version 
of FreeBSD made it not longer applicable, but there were reports of it still 
being necessary for FreebSD 7. FreeBSD 6 - 8 should be tested with this test 
script:

#!/usr/bin/env python

from ctypes import *

cdll.LoadLibrary(libc.so.7)
libc = CDLL(libc.so.7)

assert libc.isspace(0xa0) == 0


I've also attached a patch for python 2.7.3.

--
components: Unicode, ctypes
files: patch-pyport.h
messages: 165550
nosy: JohnSchneider, ezio.melotti
priority: normal
severity: normal
status: open
title: pyport.h includes antiquated UTF handling for FreeBSD
versions: Python 2.7
Added file: http://bugs.python.org/file26388/patch-pyport.h

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



[issue12978] Figure out extended attributes on BSDs

2012-07-15 Thread koobs

koobs koobs.free...@gmail.com added the comment:

FreeBSD (at least on 7.x, 8.x and 9.x) has the following syscalls available in 
its API:

extattr_{get,set,list,delete}_{fd,file,link}

And also has: EXTATTR_MAXNAMELEN

http://www.freebsd.org/cgi/man.cgi?query=extattrsektion=2manpath=FreeBSD+9.0-RELEASE

--
nosy: +koobs

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



[issue15320] thread-safety issue in regrtest.main()

2012-07-15 Thread Chris Jerdonek

Chris Jerdonek chris.jerdo...@gmail.com added the comment:

Thanks a lot for the feedback.  The thinking was to use a stand-alone (even 
testable) construct with dependencies made explicit.  For example, it wasn't 
obvious that the current iterator depended on forever, or whether the 
args_tuple parameter was a necessary part of it.  But I agree it should be 
simplified.

Here is a simpler patch, keeping iterator semantics.  My preference is to avoid 
adding lock semantics and additional complexity directly to main(), even though 
doing so would permit a smaller patch.

--
Added file: http://bugs.python.org/file26389/issue-15320-4.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15320
___
___
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-15 Thread Terry J. Reedy

New submission from Terry J. Reedy tjre...@udel.edu:

I have (had ;-) a project file ~template.py with common boilerplate.
To start a new project file, I want to open the above and save as xyz.py. I can 
edit and 'save' the template to update it just fine. But trying to do a 'save 
as' to a new name, in Idle editor, on all three current versions, I get (when 
starting Idle from command window)

Exception in Tkinter callback
Traceback (most recent call last):
  File C:\Programs\Python33\lib\tkinter\__init__.py, line 1442, in __call__
return self.func(*args)
  File C:\Programs\Python33\lib\idlelib\IOBinding.py, line 347, in save_as
filename = self.asksavefile()
  File C:\Programs\Python33\lib\idlelib\IOBinding.py, line 514, in asksavefile

filename = self.savedialog.show(initialdir=dir, initialfile=base)
  File C:\Programs\Python33\lib\tkinter\commondialog.py, line 48, in show
s = w.tk.call(self.command, *w._options(self.options))
_tkinter.TclError: user template.py doesn't exist

When starting Idle normally, this causes it to silently close. When run from 
the cp interpreter, the edit window blinks but continues while the trackback is 
printed in the cp window.

Just saving does not bring up a dialog; hence no problem. And I understand that 
'~' has special meaning on *nix, but I am running on Windows.

I changed '~' to '@' and the file still sorts at the top (though above 
__init__.py rather than below) and save as now works as it should. I know that 
save as worked for this file last October, but while I think it had the same 
~name then, I cannot be sure. Maybe I added '~' after the last time I 
successfully used the file.

As near as I can tell, asksavefile() passes initialfile = base = '~template.py' 
to savedialog.show which passes it unchanged and unexamined to tk.call. So the 
special casing of ~ seems to happen in tcl/tk out of our control. I am not sure 
if doing this on Windows is a tcl/tk bug or not.

For Windows, just removing '~' or even blanking the name before the .show() 
might be sensible, but maybe not for *nix.

Instead, we could catch the error instead of letting it crash Idle and put up a 
message box to the effect that one cannot 'save as' when editing a file named 
'~'. More specifically, in IOBinding.py, line 514 or so, replace

filename = self.savedialog.show(initialdir=dir, initialfile=base)

with

try:
filename = self.savedialog.show(initialdir=dir, initialfile=base)
except TclError as e:
if e.args[0].startswith('user'):
xxx display message, click ok
filename = None

I am assuming the None is the return from canceled dialogs. Certainly, None 
caused the file save code back up in saveas() (346) to skip the save.

The message could be something like tcl/tk gives special treatment to file 
names starting with '~' and returned this error message {}.format(e.args[0])

We could also add else: message('unanticipated tclerror prevented save as 
dialog message)

--
components: IDLE
messages: 165553
nosy: serwy, terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: Idle/tkinter ~x.py 'save as' fails. closes idle
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3

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



[issue15202] followlinks/follow_symlinks/symlinks flags unification

2012-07-15 Thread Larry Hastings

Larry Hastings la...@hastings.org added the comment:

Sorry; the patch didn't apply cleanly, and it looks like I bungled doing it 
manually.  Fixing now.

--

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



[issue15202] followlinks/follow_symlinks/symlinks flags unification

2012-07-15 Thread Roundup Robot

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

New changeset e26113f17309 by Larry Hastings in branch 'default':
Issue #15202: Additional documentation fixes inadvertently omitted
http://hg.python.org/cpython/rev/e26113f17309

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15202
___
___
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-15 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

IDLE silently closing is due to issue13582.

On Linux (Ubuntu 11.04, Tk8.5) I can not specify ~template.py for a filename 
for opening or saving a file. Clicking on either open or save produces no 
action. However, I can specify ~/template.py.

On Win7 I see there error Terry describes. This is due to Tilde Substitution 
described here: http://www.tcl.tk/man/tcl/TclCmd/filename.htm#M20

Attached is a patch against 3.3 that escapes the initial tilde on Windows. The 
patch should be identical against 3.2 and 2.7.

--
keywords: +patch
Added file: http://bugs.python.org/file26390/tilde_escape.patch

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



[issue4640] optparse doesn’t disallow adding one-dash long options (“-option”)

2012-07-15 Thread Roundup Robot

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

New changeset 844bb753570f by R David Murray in branch 'default':
#4640: Add optparse tests for '-xxx' invalid when defining options.
http://hg.python.org/cpython/rev/844bb753570f

--
nosy: +python-dev

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



[issue4640] optparse doesn’t disallow adding one-dash long options (“-option”)

2012-07-15 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Re-reading the issue I think the OP was not trying to define '-debug', but was 
indeed reporting the behavior when -debug was passed to the parser.  I've 
committed your tests (thanks).  

So we now have tests for both cases, and this issue can be closed as invalid.

--
resolution: accepted - invalid
stage: needs patch - committed/rejected
status: open - closed

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



[issue7957] Tutorial issue regarding the sys module

2012-07-15 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

IDLE supporting sys.ps1 and sys.ps2 is discussed in issue13657. I am closing 
this issue in favor of that one.

--
nosy: +serwy
resolution:  - duplicate
status: open - closed
superseder:  - IDLE doesn't support sys.ps1 and sys.ps2.

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



[issue6171] IDLE - Class Browser selection in Ubuntu

2012-07-15 Thread Roger Serwy

Changes by Roger Serwy roger.se...@gmail.com:


--
nosy: +serwy
title: Class Browser selection in Ubuntu - IDLE - Class Browser selection in 
Ubuntu

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



[issue15151] Documentation for Signature, Parameter and signature in inspect module

2012-07-15 Thread Larry Hastings

Larry Hastings la...@hastings.org added the comment:

Is anyone working on this?  I could possibly take a stab at it tonight, if I 
get the evening to myself.

--

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



[issue6804] IDLE: Detect Python files even if name doesn't end in .py

2012-07-15 Thread Roger Serwy

Roger Serwy roger.se...@gmail.com added the comment:

This is related to issue6858. I assume that the point of this issue is to 
enable syntax highlighting by relying on the Windows registry?

--
nosy: +serwy

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



[issue15356] '\xa0' isspace returns true while compiling python on solaris 10 by users using gcc 3.4.6

2012-07-15 Thread zoupl

zoupl zoupen...@gmail.com added the comment:

I have just tried on solaris. I will try the solution of issue 1571184, thanks 
a lot.

--

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



[issue14988] _elementtree: Raise ImportError when importing of pyexpat fails

2012-07-15 Thread Benjamin Peterson

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

IMHO, it can be fixed as people were relying on the old behavior.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14988
___
___
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-15 Thread Brian Thorne

Brian Thorne hardb...@gmail.com added the comment:

Once I've got more complete examples, I can update the patch to include a 
testcase.

--

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



[issue15342] os.path.join behavior

2012-07-15 Thread Yongzhi Pan

Yongzhi Pan fossi...@users.sourceforge.net added the comment:

I suggest append An empty last part will result in a path that ends with a 
separator or something similar to the docstring, though it is already in the 
HTML documentation. 

Suppose someone does this like me:

In [10]: join('a', sep)
Out[10]: '/'

He must be surprised. He has to guess how to append a separator if he does not 
look at the code, or fiddle around until he finds the soultion. 

Given it explained in the docstring, after he sees:

In [10]: join('a', sep)
Out[10]: '/'

He will probably look at the docstring:

In [16]: join?
Type:   function
Base Class: type 'function'
String Form:function join at 0x7f053fc93ed8
Namespace:  Interactive
File:   /usr/lib/python2.7/posixpath.py
Definition: join(a, *p)
Docstring:
Join two or more pathname components, inserting '/' as needed.
If any component is an absolute path, all previous path components
will be discarded. An empty last part will result in a path that
ends with a separator.

Ok, he immediately knows he has to supply an empty string instead of a 
separator.

--

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



[issue13590] extension module builds fail with python.org OS X installers on OS X 10.7 and 10.6 with Xcode 4.2

2012-07-15 Thread Roundup Robot

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

New changeset 6a1e983647bd by Ned Deily in branch 'default':
Issue #13590: Improve support for OS X Xcode 4:
http://hg.python.org/cpython/rev/6a1e983647bd

--

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



[issue15233] atexit: guarantee order of execution of registered functions?

2012-07-15 Thread Larry Hastings

Larry Hastings la...@hastings.org added the comment:

I have been meditating on this, and I'm not sure we should change 2.7.  3.2 
might be okay.

The thing is, I fear we're not just talking about CPython implementation 
details, we're talking about the Python Standard Library.  The existing 
documentation clearly gives alternative implementations free license to call 
atexit registered functions in any order they like.  So it's conceivable that 
other implementations don't guarantee reverse order.

I don't know what the right thing is to do here.  It seems like we could define 
atexit's behavior for 2.7 *if* all the major alternative implementations 
happily also implicitly guarantee reverse order.  Failing that we probably 
shouldn't touch it.  Or we could just document that reverse order is guaranteed 
in CPython only.

Of course, there are no alternative implementations that support 3.2.  That's 
why I think 3.2 might be okay.  It does seem strange to redefine part of the 
implicit language spec more than a year after the release shipped though.

--

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



[issue14635] telnetlib uses select instead of poll - limited to FD_SETSIZE fds

2012-07-15 Thread Gregory P. Smith

Gregory P. Smith g...@krypto.org added the comment:

looking at this now.  2.7 commit first; then i'll forward port to 3.2/3.3.

--
assignee: jackdied - gregory.p.smith

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



[issue14635] telnetlib uses select instead of poll - limited to FD_SETSIZE fds

2012-07-15 Thread Roundup Robot

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

New changeset c53e3aacb816 by Gregory P. Smith in branch '2.7':
Fixes Issue #14635: telnetlib will use poll() rather than select() when possible
http://hg.python.org/cpython/rev/c53e3aacb816

--
nosy: +python-dev

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



[issue11698] Improve repr for structseq objects to show named, but unindexed fields

2012-07-15 Thread David Lam

David Lam d...@dlam.me added the comment:

hi hi,  found this bug after clicking the Easy issues link

i basically just took Ray's hint to look at the __reduce__ method, and applied 
it to the __repr__ method in this patch

also updated is the test_repr() unittest

--
keywords: +patch
nosy: +dlam
Added file: http://bugs.python.org/file26391/issue11698.patch

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



[issue15352] importlib.h should be regenerated when the marshaling code changes

2012-07-15 Thread Meador Inge

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

Hmmm, I guess the idempotency issue is no worse than it already is -- the
same thing can still happen with trivial changes to the other prerequisites 
for importlib.h.

Consider this small example (you might have to run sample program multiple 
times to see a difference):

$ cat dis-closure.py
import dis

def adder(a, b):
def add():
return a + b
return add

print(dis.dis(adder(1, 2).__code__))

$  ./python.exe dis-closure.py
  5   0 LOAD_DEREF   0 (a) 
  3 LOAD_DEREF   1 (b) 
  6 BINARY_ADD   
  7 RETURN_VALUE 
None
$  ./python.exe dis-closure.py
  5   0 LOAD_DEREF   1 (a) 
  3 LOAD_DEREF   0 (b) 
  6 BINARY_ADD   
  7 RETURN_VALUE 
None

The order of 'co_cellvars', 'co_varnames', and 'co_freevars' can be
different from compile to compile, thus the bytecode can be different
from compile to compile (I am not sure if this is worth fixing).

Thus there may be times where importlib.h is regenerated, but the changes 
in the bytecode aren't significant.

I will just commit this patch as is.

--

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