[issue15580] fix True/False/None reST markup

2012-08-08 Thread Georg Brandl

Georg Brandl added the comment:

Agreed with David.

--
nosy: +georg.brandl
resolution:  - wont fix
status: open - closed

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



[issue15424] __sizeof__ of array should include size of items

2012-08-08 Thread Georg Brandl

Georg Brandl added the comment:

LGTM.

--

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



[issue15580] fix True/False/None reST markup

2012-08-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Yes, I can see the trade off.  However, is there a sense in which the situation 
for documentation could be different from the situation for code?

With code, style and refactoring changes cause churn without directly 
benefiting the end user (because code is just a means and not the end).  We can 
hold off on refactoring without impacting the end user.

With documentation though, these are visible, albeit small changes that will 
directly improve the user's experience.  We would be holding off on improving 
the pages for the sake of internal churn.  (If it was refactoring reST in a way 
that didn't change the HTML output, it would be a different story.)

--

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



[issue14182] collections.Counter equality test thrown-off by zero counts

2012-08-08 Thread Stephen Webber

Stephen Webber added the comment:

Hmm, that is odd behavior indeed.

I think having keys that point to zero values is important for iterating over a 
set. For example:

 x = Counter(a=10, b=0)
 for k in set(x):
... x[k] += 1
... 
 x
Counter({'a': 11, 'b': 1})

is probably preferable to

 x = Counter(a=10, b=0)
 for k in set(x):
... x[k] += 1
... 
 x
Counter({'a': 11})

Perhaps to ensure intuitive behavior we could ensure that

 Counter(a = 3) + Counter(b = 0) == Counter(a = 3, b = 0)
True

by aggregating all keys into the new Counter object, even those with zero 
values? I would be happy to make such a patch, as it would be good experience 
for me to learn. Would this be an acceptable solution, and is there other odd 
behavior at work here?

--

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



[issue15580] fix True/False/None reST markup

2012-08-08 Thread Georg Brandl

Georg Brandl added the comment:

We have to draw the line somewhere.  Otherwise there will be dozens of issues 
like this, introducing potential breakage and costing developer time that can 
better be spent elsewhere.

The rule in the devguide is mostly there so that developers don't bother 
writing more than they have to (since None/True/False occur so often typing the 
link every time will feel painful after a few times).  If the link is already 
written, it does absolutely no harm, as David said.  Therefore, there is no 
actual improvement as you claim.

This is nothing against you and your efforts, Chris -- you've already helped 
improve the docs quite a lot.

--

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



[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-08 Thread Ezio Melotti

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


--
keywords: +easy
nosy: +ezio.melotti
stage:  - needs patch

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



[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-08 Thread Sarbjit singh

New submission from Sarbjit singh:

Please provide some basic usage examples for ElementTree module documentation. 
While parsing an xml, most common scenarios will be reading elements from xml, 
modifying elements, removal of elements. Though there are few examples given 
for modification of xml element. 

But if you look from beginners learning point of view, its very hard to just 
get any idea from the example that is currently provided. There is lot of text 
there, but what would be more helpful is some small examples for each function 
so that user can quickly understand its usage there only.  I myself is learning 
Python, but in order to start using this module, i had to search lot of 
articles on internet on usage of this module. If we could have provided some 
basic use cases in Python doc itself, user would not have to rely on external 
sources for learning its usage.

Some Basic Scenarios:
1) Parsing an xml and finding some elements of xml
2) deletion of an element from an xml and writing back
3) Modification of an xml element
4) Usage of XPath queries (some basic usage)

--
assignee: docs@python
components: Documentation
messages: 167670
nosy: Sarbjit.singh, docs@python, eli.bendersky
priority: normal
severity: normal
status: open
title: Provide some examples for usage of ElementTree methods/attributes
type: enhancement

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



[issue15587] IDLE is pixelated on the Macbook Pro with Retina Display

2012-08-08 Thread Tyler Crompton

New submission from Tyler Crompton:

I think this is more of a Tkinter issue than IDLE but since IDLE uses Tkinter, 
it inherits this bug. Many programs that were not developed for the Macbook 
Pro with Retina Display still look great. Whereas others, look pixelated in 
some areas (i.e. the current stable release of Google Chrome IIRC (I installed 
the beta to get around that)), and some are just flat out pixelated everywhere. 
IDLE falls into the latter category. I know IDLE really has its issues and that 
few people use it, but it's a cosmetic change that I don't see being too 
difficult. Then again, I know hardly anything about how it is implemented.

--
components: IDLE, Tkinter
files: Screen Shot 2012-08-08 at 2.07.19 AM.png
messages: 167671
nosy: Tyler.Crompton
priority: normal
severity: normal
status: open
title: IDLE is pixelated on the Macbook Pro with Retina Display
type: enhancement
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3, Python 3.4
Added file: http://bugs.python.org/file26724/Screen Shot 2012-08-08 at 2.07.19 
AM.png

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



[issue15588] quopri: encodestring and decodestring handle bytes, not strings

2012-08-08 Thread patrick vrijlandt

New submission from patrick vrijlandt:

quopri.py's functions encodestring and decodestring are documented to handle 
strings; and this is clearly suggested by their name. However, these functions 
accept and return bytes, not strings. This should be reflected in the 
documentation. 

Even better: deprecate these functions and introduce new ones with behaviour as 
suggested by their names: encode_string, encode_bytes etc.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 167672
nosy: docs@python, patrick.vrijlandt
priority: normal
severity: normal
status: open
title: quopri: encodestring and decodestring handle bytes, not strings
type: behavior
versions: Python 3.2

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Someone broke the Windows buildbots.

--
assignee:  - haypo
stage: committed/rejected - needs patch

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



[issue14182] collections.Counter equality test thrown-off by zero counts

2012-08-08 Thread Raymond Hettinger

Raymond Hettinger added the comment:

At its most basic, a Counter is simply a dictionary with a __missing__ method 
that supplies a default of zero.  It is intentional that everything else 
behaves as much like a regular dictionary as possible.  You're allowed to store 
*anything* in the dict values even if those values don't represent numbers.  A 
consequence is that equality is taken to mean the same a regular dict equality.

The unary-plus is provided as a way to eliminate zeros from a Counter prior to 
doing a Counter equality test.

Other designs were possible (such as my Bag class mentioned in the docs).  This 
one was selected for its versatility, but it does present challenges with 
respect to zeros, negatives, fractions, etc.  I recognize your concern but find 
it to be at odds with the basic design of the class.  You might be happier with 
a Multiset class that restricts itself to positive integer counts.

--
priority: normal - low
resolution:  - rejected
status: open - closed

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



[issue15475] Correct __sizeof__ support for itertools

2012-08-08 Thread Raymond Hettinger

Changes by Raymond Hettinger raymond.hettin...@gmail.com:


--
assignee:  - rhettinger
priority: normal - low

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



[issue15544] math.isnan fails with some Decimal NaNs

2012-08-08 Thread Raymond Hettinger

Raymond Hettinger added the comment:

-0.5 on making the math module functions aware of decimals.  

The math module was originally conceived as thin wrapper around the C math 
library.  Subsequently, it has had feature creep (I'm guilty of putting the 
integer factorial method in this module).  I don't think further creep and loss 
of focus is warranted.

Making some functions decimal aware and others not is probably not a good idea.

Also, if someone is using decimals, they are better of using the methods 
supplied in that module (those have at least passed the huge battery of tests 
for compliance with the spec).

--
nosy: +rhettinger

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



[issue15578] Crash when modifying sys.modules during import

2012-08-08 Thread nordaux

Changes by nordaux nord...@gmail.com:


--
nosy: +nordaux

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



[issue15587] IDLE is pixelated on the Macbook Pro with Retina Display

2012-08-08 Thread Ned Deily

Ned Deily added the comment:

Text rendering in Tkinter applications like IDLE is a service of the underlying 
Tcl/Tk implementation.  Essentially, all that IDLE does is to pass text in a 
requested font face and font size through Tkinter to Tcl/Tk which may then use 
whatever approach it wants to render the text.  IDLE does allow you to select a 
font face and text size in the IDLE Preferences Font/Tabs tab.  You may want to 
experiment there to find a satisfactory combination of settings for your use.  
If you can't and there is something specific that needs to change, it will 
almost certainly have to be done by the Tcl/Tk project.  Feel free to reopen 
this issue if you can identify specific deficiencies in IDLE or Tkinter.

--
nosy: +ned.deily
resolution:  - invalid
stage:  - committed/rejected
status: open - closed
versions:  -Python 2.6, Python 3.1, Python 3.4

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



[issue15550] Trailing white spaces

2012-08-08 Thread Ned Deily

Ned Deily added the comment:

Since we've established that python files are already covered by 'make 
patchcheck' and the hg checkin hook and that there does not appear to be much 
enthusiasm for extending the hook to C files or to wholesale whitespace 
cleanup, the remaining issue is whether to extend 'make patchcheck' for C 
files. And that is the subject of open Issue8912.  So I'm going to close this 
issue as a duplicate of that one and suggest further discussion take place 
there.  As for a per-file bypass, I'm not aware of any nor of any need that has 
arisen so far for one.

--
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - `make patchcheck` should check the whitespace of .c/.h files

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Stefan Krah

New submission from Stefan Krah:

Running *any* test of the test suite currently produces a bus error
on Debian sparc [http://people.debian.org/~aurel32/qemu/sparc/].

After the bus error, the tests seem to proceed normally though.

This is definitely new. I've been testing memoryview for bus errors
a couple of months ago without problems.


Georg, I'm provisionally setting this to release blocker. The
qemu-sparc image is quite old though (Debian Etch). It's a pity
we don't have a sparc buildbot any more.




Example:


user@debian-sparc:~/cpython$ ./python -m test -uall -v test_flufl
== CPython 3.3.0b1 (default:67d36e8ddcfc+, Aug 7 2012, 23:49:57) [GCC 4.1.2 
20061115 (prerelease) (Debian 4.1.1-21)]
Fatal Python error: Bus error

Current thread 0x4000:
  File /home/user/cpython/Lib/subprocess.py, line 1363 in _execute_child
  File /home/user/cpython/Lib/subprocess.py, line 818 in __init__
  File /home/user/cpython/Lib/os.py, line 995 in popen
  File /home/user/cpython/Lib/platform.py, line 903 in _syscmd_uname
  File /home/user/cpython/Lib/platform.py, line 1147 in uname
  File /home/user/cpython/Lib/platform.py, line 1452 in platform
  File /home/user/cpython/Lib/test/regrtest.py, line 537 in main
  File /home/user/cpython/Lib/test/__main__.py, line 13 in module
  File /home/user/cpython/Lib/runpy.py, line 73 in _run_code
  File /home/user/cpython/Lib/runpy.py, line 160 in _run_module_as_main
==   Linux-2.6.18-6-sparc32-sparc-with-debian-4.0 big-endian
==   /home/user/cpython/build/test_python_3262
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1)
[1/1] test_flufl
test_barry_as_bdfl (test.test_flufl.FLUFLTests) ... ok
test_guido_as_bdfl (test.test_flufl.FLUFLTests) ... ok

--
Ran 2 tests in 0.053s

OK
1 test OK.

--
keywords: 3.2regression
messages: 167678
nosy: georg.brandl, skrah
priority: release blocker
severity: normal
stage: needs patch
status: open
title: Bus error on Debian sparc
type: crash
versions: Python 3.3

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Stefan Krah

Stefan Krah added the comment:

Setting to critical: debian-sparc 32-bit is apparently deprecated
since Lenny and still uses linuxthreads.

Tracking down the failure could end up in finding a platform bug
like in #12936.

--
priority: release blocker - critical

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



[issue11715] Building Python on multiarch Debian and Ubuntu

2012-08-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 5966c206654b by doko in branch 'default':
- Issue #11715: Fix multiarch detection without having Debian development
http://hg.python.org/cpython/rev/5966c206654b

--

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



[issue14330] don't use host python, use host search paths for host compiler

2012-08-08 Thread Matthias Klose

Matthias Klose added the comment:

committed the ma.diff from #11715, msg167680.

--
resolution:  - fixed
status: open - closed

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



[issue11715] Building Python on multiarch Debian and Ubuntu

2012-08-08 Thread Matthias Klose

Changes by Matthias Klose d...@debian.org:


--
resolution:  - fixed
status: open - closed

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



[issue15475] Correct __sizeof__ support for itertools

2012-08-08 Thread Raymond Hettinger

Raymond Hettinger added the comment:

The clean-up patch looks much nicer.  Thanks.

I'm not sure why anyone would really want this functionality for itertools, but 
I don't see any harm in adding it as long as the other implementations aren't 
required to follow.

Also, it could be viewed as being a new feature, so I'm not sure backports are 
warranted.  Be sure to ask the respective release managers before applying.

--
assignee: rhettinger - 

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



[issue15590] --libs is inconsistent for python-config --libs and pkgconfig python --libs

2012-08-08 Thread Matthias Klose

New submission from Matthias Klose:

seen with at least 2.7, 3.2 and 3.3:

$ python-config --libs
-lpthread -ldl -lutil -lm -lpython2.7

$ pkg-config python --static --libs
-lpthread -ldl -lutil -lpython2.7

python-config uses the SYSLIBS macro, while pkg-config uses the LIBS macro.

depending on what you want to do, both can be wrong or right:

 - to build an extension, LIBS should be used.

 - to link an embedded interpreter, SYSLIBS should be used,
   which might not be complete.
   Howver in this case MODLIBS is missing.

a patch should be easy once we can define the intended behaviour.

--
components: Build
keywords: needs review
messages: 167683
nosy: doko
priority: normal
severity: normal
status: open
title: --libs is inconsistent for python-config --libs and pkgconfig python 
--libs
type: behavior
versions: Python 3.3

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



[issue15591] when building the extensions, stdout is lost when stdout is redirected

2012-08-08 Thread Matthias Klose

New submission from Matthias Klose:

I see this on all Debian and Ubuntu releases, when stdout is redirected. I 
expect to see the compiler and linker invocations for the sharedmods target, 
but I only see stderr (compiler and linker warnings).

e.g. make 21 | tee log
or   script -c 'make' log

can this be reproduced on Debian/Ubuntu, or is this seen on other Linux 
distributions as well?

--
components: Build
messages: 167684
nosy: doko
priority: normal
severity: normal
status: open
title: when building the extensions, stdout is lost when stdout is redirected
type: behavior
versions: Python 2.6, Python 2.7, Python 3.2, Python 3.3

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



[issue15426] On a x86_64 Linux workstation, the build-from-source is borked.

2012-08-08 Thread Matthias Klose

Matthias Klose added the comment:

I don't think so. lib is hardcoded for any python release, so this issue 
shouldn't be specific to 3.3.

--

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



[issue15590] --libs is inconsistent for python-config --libs and pkgconfig python --libs

2012-08-08 Thread Arfrever Frehtes Taifersar Arahesis

Arfrever Frehtes Taifersar Arahesis added the comment:

Behavior of 'pkg-config python' is more useful since without --static option 
only the set of directly needed libraries is returned.

In Python 3.3 or 3.4 --static option could be introduced in python-config and 
behavior without this option could be changed to match 'pkg-config python'.

--
nosy: +Arfrever

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



[issue15573] Support unknown formats in memoryview comparisons

2012-08-08 Thread Stefan Krah

Stefan Krah added the comment:

Right, byte order specifiers are always at the beginning of the string.
That is at least something. I wonder if we should tighten PEP-3118 to
demand a canonical form of format strings, such as (probably incomplete):

  - Whitespace is disallowed.

  - Except for 's', no zero count may be given.

  - A count of 1 (redundant) is disallowed.

  - Repeats must be specified in terms of count + single char.


That still leaves the '=I' != '=L' problem. Why are there two
specifiers describing uint32_t?


Anyway, as Meador says, this can get tricky and I don't think this
can be resolved before beta-2. I'm attaching a patch that should
behave well for the restricted canonical form at least.

--
keywords: +patch
Added file: http://bugs.python.org/file26725/issue15573.diff

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread STINNER Victor

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


--
nosy: +haypo

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



[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-08 Thread Daniel Ellis

Daniel Ellis added the comment:

I have been working with ElementTree for the last few months and would love to 
help out with this.

--
nosy: +Daniel.Ellis

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



[issue15475] Correct __sizeof__ support for itertools

2012-08-08 Thread Meador Inge

Meador Inge added the comment:

On Wed, Aug 8, 2012 at 5:41 AM, Raymond Hettinger rep...@bugs.python.org 
wrote:

 I'm not sure why anyone would really want this functionality for itertools,
 but I don't see any harm in adding it as long as the other implementations
 aren't required to follow.

The general expection is that __sizeof__ is for CPython.  We tag the tests
with '@cpython_only'.

 Also, it could be viewed as being a new feature, so I'm not sure backports
 are warranted. 

So far, we have been applying the __sizeof__ patches to all branches.

 Be sure to ask the respective release managers before applying.

I will check with Georg for 3.3.  Thanks.

--
assignee:  - meador.inge

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



[issue14182] collections.Counter equality test thrown-off by zero counts

2012-08-08 Thread Eric Snow

Eric Snow added the comment:

I'd missed that unary + (new in 3.3).  That's pretty cool.

--
nosy: +eric.snow

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



[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-08 Thread Ezio Melotti

Ezio Melotti added the comment:

Daniel, I would suggest you to start with a basic example that gives an idea 
about how to use the module and its main functionalities.  If necessary you 
could add a section at the bottom with more examples.
You can also show how a method works with a short snippet (2-3 lines) just 
after the documentation of the method, but this doesn't mean that every method 
should have one.
If you have lot of examples you might consider doing a separate tutorial/howto.

As a reference see the examples in 
http://docs.python.org/py3k/library/html.parser.html and 
http://docs.python.org/py3k/library/unittest.html#basic-example.

--

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



[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-08 Thread Daniel Ellis

Daniel Ellis added the comment:

Thank you Ezio, I will use that as a reference.  What is the general
workflow for updating documentation across python versions?  Should I check
to see if the documentation for the module changes across python versions
and create patches for each version?  Or is it sufficient to create a patch
for one version?

On Wed, Aug 8, 2012 at 12:07 PM, Ezio Melotti rep...@bugs.python.orgwrote:


 Ezio Melotti added the comment:

 Daniel, I would suggest you to start with a basic example that gives an
 idea about how to use the module and its main functionalities.  If
 necessary you could add a section at the bottom with more examples.
 You can also show how a method works with a short snippet (2-3 lines) just
 after the documentation of the method, but this doesn't mean that every
 method should have one.
 If you have lot of examples you might consider doing a separate
 tutorial/howto.

 As a reference see the examples in
 http://docs.python.org/py3k/library/html.parser.html and
 http://docs.python.org/py3k/library/unittest.html#basic-example.

 --

 ___
 Python tracker rep...@bugs.python.org
 http://bugs.python.org/issue15586
 ___


--

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



[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-08 Thread Ezio Melotti

Ezio Melotti added the comment:

Usually a patch against default (i.e. Python 3) is enough, if there are 
several differences with Python 2 you might want to provide one for 2.7 too.

See also the devguide at http://docs.python.org/devguide/ for more information 
about the workflow.

--

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



[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-08 Thread Chris Jerdonek

New submission from Chris Jerdonek:

Popen.communicate() raises an exception if passed no input when stdin=PIPE and 
universal_newlines=True.  With universal_newlines=False, no exception is 
raised.  For example, the following yields--

args = [sys.executable, '-c', 'pass']

popen = Popen(args, universal_newlines=False, stdin=PIPE, stdout=PIPE, 
stderr=PIPE)
print(popen.communicate())

popen = Popen(args, universal_newlines=True, stdin=PIPE, stdout=PIPE, 
stderr=PIPE)
print(popen.communicate())

(b'', b'[41449 refs]\n')
Traceback (most recent call last):
  ...
  File .../Lib/subprocess.py, line 1581, in _communicate_with_poll
self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'NoneType' object has no attribute 'encode'

It seems like communicate() should not be trying to encode input if there is 
none.

I can provide a patch with tests if it is agreed this is an issue (along with a 
fix assuming it is reasonable).

--
components: Library (Lib)
messages: 167694
nosy: cjerdonek
priority: normal
severity: normal
stage: test needed
status: open
title: subprocess.communicate() breaks on no input with universal newlines true
type: behavior
versions: Python 3.3

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



[issue9327] doctest DocFileCase setUp/tearDown asymmetry

2012-08-08 Thread Marius Gedminas

Marius Gedminas added the comment:

Duplicate of issue2604?

--
nosy: +mgedmin

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



[issue2604] doctest.DocTestCase fails when run repeatedly

2012-08-08 Thread Marius Gedminas

Marius Gedminas added the comment:

For the record, this bug also breaks zope.testrunner's --repeat option, if you 
have any doctests in your test suite that rely on test.globs not going away.

--
nosy: +mgedmin

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



[issue15592] subprocess.communicate() breaks on no input with universal newlines true

2012-08-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

See issue 12623 for another issue related to communicate() and universal 
newline support.

--
nosy: +pitrou

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



[issue15584] os.popen deprecation warning not in Python 3 docs

2012-08-08 Thread R. David Murray

R. David Murray added the comment:

That's because we ultimately decided not to remove it.

--
nosy: +r.david.murray
resolution:  - duplicate
status: open - closed
superseder:  - os.popen documentation  is probably wrong

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



[issue15585] usage of os.popen in standard library

2012-08-08 Thread R. David Murray

R. David Murray added the comment:

There is already an open issue for this, with a (partial?) patch.

--
nosy: +r.david.murray
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - os.popen documentation  is probably wrong

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



[issue15588] quopri: encodestring and decodestring handle bytes, not strings

2012-08-08 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
components: +email
nosy: +barry, r.david.murray
versions: +Python 3.3, Python 3.4

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



[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-08 Thread Eli Bendersky

Eli Bendersky added the comment:

Please note that the documentation of ET has been significantly improved in 
3.3, with added examples, etc. You can start by backporting whatever is 
relevant to earlier versions (2.7/3.2) - do not add new documentation contents 
to 2.7/3.2 before the changes from 3.3 are backported, because we can't have 
divergent docs.

--

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Georg Brandl

Georg Brandl added the comment:

From the position of the bus error, it would seem that calling a subprocess 
during platform.platform() is the culprit.

But if test_subprocess passes without any bus errors, that would be strange.

--

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e0f3406c43e4 by Victor Stinner in branch 'default':
Issue #13072: Fix test_array for Windows with 16-bit wchar_t
http://hg.python.org/cpython/rev/e0f3406c43e4

--

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 67a994d5657d by Victor Stinner in branch 'default':
Issue #13072: Ooops, now fix test_array for Linux with 32-bit wchar_t...
http://hg.python.org/cpython/rev/67a994d5657d

--

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



[issue15501] Document exception classes in subprocess module

2012-08-08 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Please update your patches:
1. use attribute:: 
2. point base class for exception if it is not Exception
3. enumerate all attributes (`cmd` for CalledProcessError)

Example:

.. exception:: HTTPError

   Though being an exception (a subclass of :exc:`URLError`), an 
:exc:`HTTPError`
   can also function as a non-exceptional file-like return value (the same thing
   that :func:`urlopen` returns).  This is useful when handling exotic HTTP
   errors, such as requests for authentication.

   .. attribute:: code

  An HTTP status code as defined in `RFC 2616 
http://www.faqs.org/rfcs/rfc2616.html`_.
  This numeric value corresponds to a value found in the dictionary of
  codes as found in :attr:`BaseHTTPServer.BaseHTTPRequestHandler.responses`.


Also please fill Contributor Agreement: http://www.python.org/psf/contrib/

--
nosy: +asvetlov

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15501
___
___
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-08-08 Thread Andrew Svetlov

Andrew Svetlov added the comment:

Yury, please updete your patch to pass doctest:

./python -m doctest Doc/library/inspect.html

--
nosy: +asvetlov

___
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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Ned Deily

Ned Deily added the comment:

Is it by any chance a --shared build being run from the build directory without 
having been installed (and without a LD_LIBRARY_PATH and with an older version 
already installed)?

--
nosy: +ned.deily

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



[issue15593] urlparse.parse_qs documentation wrong re: urlencode

2012-08-08 Thread Rob Kinyon

New submission from Rob Kinyon:

This may appear to be a duplicate of http://bugs.python.org/issue12390 and 
http://bugs.python.org/issue833405, but it's not.

The documentation of urlparse.parse_qs() should state that in order for 
urllib.urlencode to properly reverse its output, the doseq parameter must be 
set to True. Please amend the documentation to make this very clear.

Ideally, the documentation of urlencode() would also make it clear that 
doseq=True is required if the output is from parse_qs().

--
assignee: docs@python
components: Documentation
messages: 167707
nosy: Rob.Kinyon, docs@python
priority: normal
severity: normal
status: open
title: urlparse.parse_qs documentation wrong re: urlencode
versions: Python 2.7

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-08 Thread Antoine Pitrou

Antoine Pitrou added the comment:

And the test fails on machines without ctypes :)

--

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



[issue15510] textwrap.wrap('') returns empty list

2012-08-08 Thread Ethan Furman

Ethan Furman added the comment:

Chris Jerdonek wrote:
 Here is an example on a paragraph with line breaks between paragraphs:

s/paragraph/text/

 def wrap_paras(text, width=70, **kwargs):
 ... lines = [line for para in text.splitlines()
 ...   for line in wrap(para, width, **kwargs)]
 ... return \n.join(lines)
 ...
 text = \
 ... abcd abcd
 ...
 ... abcd abcd
 print(wrap_paras(text))
 abcd abcd
 abcd abcd
 
 The edge case we're discussing determines whether line breaks between 
 paragraphs are preserved in the result.  (With current behavior, they are 
 not.)

Having now more carefully read the docs (which, admittedly, I should 
have done before responding the first time) I found this:

textwrap.wrap(text, width=70, **kwargs)
Wraps the single paragraph in text . . .

textwrap.fill(text, width=70, **kwargs)
Wraps the single paragraph in text, . . .

In other words, it is not designed to work on multiple paragraphs at 
once.  And the documentation is fine.

Move along, no bug to see here, move along...

--

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



[issue15586] Provide some examples for usage of ElementTree methods/attributes

2012-08-08 Thread Daniel Ellis

Daniel Ellis added the comment:

I've made a couple more additions/changes to the documentation in the default 
branch, per Eli's recommendation, since there were already a lot of good 
examples added.  I'd like to also backport this to 2.7 but wanted to make sure 
these changes were good before moving forward.  I just saw Eli's message about 
doing the backporting before making further changes but had already been 
working on making these changes.  I can go ahead and work on the backport if 
you feel this patch is too much to do first, but I believe every example I 
added is backwards compatible.

--
keywords: +patch
Added file: http://bugs.python.org/file26726/default_branch_etree_doc.patch

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



[issue15594] test_copyfile_named_pipe() fails on Mac OS X Snow Leopard: OSError: [Errno 22] Invalid argument

2012-08-08 Thread STINNER Victor

New submission from STINNER Victor:

==
ERROR: test_copyfile_named_pipe (test.test_shutil.TestShutil)
--
Traceback (most recent call last):
  File 
/Users/ambv/Buildbot/3.x.langa-snowleopard/build/Lib/test/test_shutil.py, 
line 735, in test_copyfile_named_pipe
os.mkfifo(TESTFN)
OSError: [Errno 22] Invalid argument

http://buildbot.python.org/all/builders/AMD64%20Snow%20Leopard%203.x/builds/162/steps/test/logs/stdio

--
assignee: ronaldoussoren
components: Macintosh
messages: 167711
nosy: haypo, ronaldoussoren
priority: normal
severity: normal
status: open
title: test_copyfile_named_pipe() fails on Mac OS X Snow Leopard: OSError: 
[Errno 22] Invalid argument
versions: Python 3.3

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



[issue15510] textwrap.wrap('') returns empty list

2012-08-08 Thread R. David Murray

R. David Murray added the comment:

Also you will note that the return of the empty list for an empty line is 
exactly what you want for wrapping multiple line-break-delimited paragraphs.  
Consider:

   doc = a para\nanother para\n\na third, but with an extra blank line 
between\n
   for line in doc.splitlines():
  ...print('\n'.join(textwrap.wrap(line, width=5)))
  ...if line:
  ...   print()
  a
  para

  anoth
  er
  para


  a thi
  rd,
  but
  with
  an
  extra
  blank
  line 
  betwe
  en

In other words, we need to add a blank line after our formatted paragraph, 
unless it is empty, in which case we don't want to add one or we'll have an 
extra.  This assumes that single-line-paragraphs do not have blank lines 
between them...if they do, then the algorithm is even simpler, as you don't 
need the if.

--

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Floris Bruynooghe

Floris Bruynooghe added the comment:

Running on Solaris 10 (T1000, OpenCSW toolchain, gcc 4.6.3) I also get a bus 
error, with added coredump:

$ ./python Lib/test/regrtest.py 
== CPython 3.3.0b1 (default:67a994d5657d, Aug 8 2012, 21:43:48) [GCC 4.6.3]
==   Solaris-2.10-sun4v-sparc-32bit big-endian
==   /export/home/flub/python/cpython/build/test_python_7320
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1)
[  1/369] test_grammar
[  2/369] test_opcodes
[  3/369] test_dict
[  4/369] test_builtin
[  5/369] test_exceptions
test test_exceptions failed -- Traceback (most recent call last):
  File /export/home/flub/python/cpython/Lib/test/test_exceptions.py, line 
432, in testChainingDescriptors
self.assertTrue(e.__suppress_context__)
AssertionError: False is not true

[  6/369/1] test_types
[  7/369/1] test_unittest
[  8/369/1] test_doctest
[  9/369/1] test_doctest2
[ 10/369/1] test_support
[ 11/369/1] test___all__
[ 12/369/1] test___future__
[ 13/369/1] test__locale
[ 14/369/1] test__osx_support
[ 15/369/1] test_abc
[ 16/369/1] test_abstract_numbers
[ 17/369/1] test_aifc
[ 18/369/1] test_argparse
[ 19/369/1] test_array
[ 20/369/1] test_ast
[ 21/369/1] test_asynchat
[ 22/369/1] test_asyncore
[ 23/369/1] test_atexit
[ 24/369/1] test_audioop
[ 25/369/1] test_augassign
[ 26/369/1] test_base64
[ 27/369/1] test_bigaddrspace
[ 28/369/1] test_bigmem
[ 29/369/1] test_binascii
[ 30/369/1] test_binhex
[ 31/369/1] test_binop
[ 32/369/1] test_bisect
[ 33/369/1] test_bool
[ 34/369/1] test_buffer
[ 35/369/1] test_bufio
[ 36/369/1] test_bytes
[ 37/369/1] test_bz2
[ 38/369/1] test_calendar
[ 39/369/1] test_call
[ 40/369/1] test_capi
Fatal Python error: Bus error

Current thread 0x0001:
  File /export/home/flub/python/cpython/Lib/test/test_capi.py, line 264 in 
test_skipitem
  File /export/home/flub/python/cpython/Lib/unittest/case.py, line 385 in 
_executeTestPart
  File /export/home/flub/python/cpython/Lib/unittest/case.py, line 440 in run
  File /export/home/flub/python/cpython/Lib/unittest/case.py, line 492 in 
__call__
  File /export/home/flub/python/cpython/Lib/unittest/suite.py, line 105 in run
  File /export/home/flub/python/cpython/Lib/unittest/suite.py, line 67 in 
__call__
  File /export/home/flub/python/cpython/Lib/unittest/suite.py, line 105 in run
  File /export/home/flub/python/cpython/Lib/unittest/suite.py, line 67 in 
__call__
  File /export/home/flub/python/cpython/Lib/test/support.py, line 1312 in run
  File /export/home/flub/python/cpython/Lib/test/support.py, line 1413 in 
_run_suite
  File /export/home/flub/python/cpython/Lib/test/support.py, line 1447 in 
run_unittest
  File /export/home/flub/python/cpython/Lib/test/test_capi.py, line 290 in 
test_main
  File Lib/test/regrtest.py, line 1219 in runtest_inner
  File Lib/test/regrtest.py, line 941 in runtest
  File Lib/test/regrtest.py, line 714 in main
  File Lib/test/regrtest.py, line 1810 in module
Bus Error (core dumped)


Not sure if this should be tracked in the same issue or not?

--
nosy: +flub

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Stefan Krah

Stefan Krah added the comment:

I think I've identified one legit Python bug. This is from a *different* 
traceback, i.e. the traceback in my first message is still unresolved.

A bus error occurs in test_capi, test_skipitem with format 'D':

Python/getargs.c:782

Py_complex *p = va_arg(*p_va, Py_complex *);
Py_complex cval;
cval = PyComplex_AsCComplex(arg);
if (PyErr_Occurred())
RETURN_ERR_OCCURRED;
else
*p = cval;  -  bus error
break;


The pointer p has value 0xefbfb1fc, with 0xefbfb1fc % 8 == 4. It originates
from a somewhat creatively allocated memory region in 
_testcapi:parse_tuple_and_keywords. :)

--
nosy: +larry

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Larry Hastings

Larry Hastings added the comment:

This platform is 8-byte aligned?

--

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Larry Hastings

Larry Hastings added the comment:

nm, I get it, doubles are 8-bytes and should be 8-byte aligned.  Let me stare 
at it some more.

--

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Stefan Krah

Stefan Krah added the comment:

Floris, the traceback in my first message only occurs in the
optimized regular build with -O3. Did you try that, too?

--

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



[issue8800] add threading.RWLock

2012-08-08 Thread Andrew Svetlov

Changes by Andrew Svetlov andrew.svet...@gmail.com:


--
nosy: +asvetlov

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Larry Hastings

Larry Hastings added the comment:

Attached is a patch attempting to force double alignment.  Stefan: please apply 
and try it.  Does this help?

--
keywords: +patch
Added file: 
http://bugs.python.org/file26727/larry.force.alignment.in.capi.test.1.diff

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



[issue15595] subprocess.Popen(universal_newlines=True) does not work for certain locales

2012-08-08 Thread Chris Jerdonek

New submission from Chris Jerdonek:

subprocess.Popen() with universal_newlines=True does not convert line breaks 
correctly when the preferred encoding is UTF-16.  For example, the following 
code--

code = rimport sys; sys.stdout.buffer.write('a\r\nb'.encode('utf-16'))
args = [sys.executable, '-c', code]
popen = Popen(args, universal_newlines=True, stdin=PIPE, stdout=PIPE)
print(popen.communicate(input=''))

yields--

('a\n\nb', None)

instead of--

('a\nb', None)

The reason is that the code attempts to convert newlines before decoding to 
unicode instead of after:

http://hg.python.org/cpython/file/85266c6f9ae4/Lib/subprocess.py#l830

I am attaching a failing test case.  I will upload a patch shortly.

Also see the related documentation issue 15561.

--
components: Library (Lib)
files: failing-test-case-1.patch
keywords: easy, patch
messages: 167719
nosy: cjerdonek
priority: normal
severity: normal
stage: needs patch
status: open
title: subprocess.Popen(universal_newlines=True) does not work for certain 
locales
type: behavior
versions: Python 3.3
Added file: http://bugs.python.org/file26728/failing-test-case-1.patch

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



[issue15595] subprocess.Popen(universal_newlines=True) does not work for certain locales

2012-08-08 Thread STINNER Victor

STINNER Victor added the comment:

 when the preferred encoding is UTF-16

What is your operating system? How do you set the locale encoding to UTF-16? Do 
you mean UTF-16, UTF-16-LE or UTF-16-BE?

--
nosy: +haypo

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



[issue15595] subprocess.Popen(universal_newlines=True) does not work for certain locales

2012-08-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Attaching patch for review.

--
stage: needs patch - patch review
Added file: http://bugs.python.org/file26729/issue-15595-1.patch

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



[issue15595] subprocess.Popen(universal_newlines=True) does not work for certain locales

2012-08-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Victor, I have not personally experienced this issue.  I just noticed that the 
order of operations is wrong or not portable in the _translate_newlines() 
method when I was looking at the code for another reason.

--

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Floris Bruynooghe

Floris Bruynooghe added the comment:

I compiled with a simple ./configure which I think is what you mean (it 
defaults to -O3).  But when executing your test it doesn't give a bus error.

--

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Stefan Krah

Stefan Krah added the comment:

Larry Hastings rep...@bugs.python.org wrote:
 Attached is a patch attempting to force double alignment. Stefan: please 
 apply and try it.  Does this help?

Yes, this works nicely.

--

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset efb30bdcfa1e by Larry Hastings in branch 'default':
Issue #15589: Ensure double-alignment for brute-force capi argument parser test
http://hg.python.org/cpython/rev/efb30bdcfa1e

--
nosy: +python-dev

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



[issue15594] test_copyfile_named_pipe() fails on Mac OS X Snow Leopard: OSError: [Errno 22] Invalid argument

2012-08-08 Thread Ned Deily

Ned Deily added the comment:

There is something odd about the setup for that buildbot.  Notice the other 
failures.  The mkfifo() call on OS X isn't even documented as returning EINVAL 
(22).  I've never seen this kind of failure on other OS X systems.   Łukasz, 
any ideas?

--
assignee: ronaldoussoren - 
nosy: +lukasz.langa, ned.deily

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



[issue15595] subprocess.Popen(universal_newlines=True) does not work for certain locales

2012-08-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

 How do you set the locale encoding to UTF-16? Do you mean UTF-16, UTF-16-LE 
 or UTF-16-BE?

I confirmed that the issue occurs for all of these.  For testing purposes, you 
can do--

locale.getpreferredencoding = lambda do_setlocale: 'utf-16'

--

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Floris Bruynooghe

Floris Bruynooghe added the comment:

I think I can confirm this fixes the BusError.  The test suite got past 
test_capi on my machine as well.  Unfortunately I killed the ssh session by 
accident before the testsuite completed so I had to restart it.

--

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



[issue15569] Doc doc: incorrect description of some roles as format-only

2012-08-08 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
assignee:  - docs@python
nosy: +docs@python, eric.araujo
stage:  - needs patch
title: Dev Guide format-only roles - Doc doc: incorrect description of some 
roles as format-only

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



[issue15582] Enhance inspect.getdoc to follow inheritance chains

2012-08-08 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
nosy: +eric.araujo

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



[issue15426] On a x86_64 Linux workstation, the build-from-source is borked.

2012-08-08 Thread Éric Araujo

Éric Araujo added the comment:

The patch seems incorrect, as not all OSes or installations use lib64.

--

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



[issue15596] pickle: Faster serialization of Unicode strings

2012-08-08 Thread STINNER Victor

New submission from STINNER Victor:

Serialization of Unicode strings in the pickle module is suboptimal, especially 
for long strings.

Attached patch optimize the serialization thanks to new properties of Unicode 
strings (PEP 393):

 * text (protocol 0): avoid any temporary buffer if the string is an ASCII or 
latin1 string without \\ or \n character; otherwise use a small buffer of 
64 KB (instead of two buffer)
 * binary (protocol 1, 2): avoid any temporary buffer if string is an ASCII 
string or if the string is already available encoded as UTF-8

The current code for protocol 0 uses raw_unicode_escape() which is really 
suboptimal: it uses a first buffer to write the escape string, and then a new 
temporary buffer to store the buffer with the right size (instead of just 
calling _PyBytes_Resize).

--
components: Library (Lib)
files: pickle_unicode.patch
keywords: patch
messages: 167730
nosy: alexandre.vassalotti, haypo, pitrou
priority: normal
severity: normal
status: open
title: pickle: Faster serialization of Unicode strings
type: performance
versions: Python 3.4
Added file: http://bugs.python.org/file26730/pickle_unicode.patch

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



[issue15596] pickle: Faster serialization of Unicode strings

2012-08-08 Thread STINNER Victor

STINNER Victor added the comment:

Oh, I forgot to explain that I initially wrote the patch to fix the following 
failure on our bigmem buildbot.

http://buildbot.python.org/all/builders/AMD64%20Ubuntu%20LTS%20bigmem%203.x/builds/165/steps/test/logs/stdio

==
ERROR: test_huge_str_32b (test.test_pickle.InMemoryPickleTests)
--
Traceback (most recent call last):
  File /opt/python-bigmem/3.x.langa-bigmem/build/Lib/test/support.py, line 
1281, in wrapper
return f(self, maxsize)
  File /opt/python-bigmem/3.x.langa-bigmem/build/Lib/test/pickletester.py, 
line 1267, in test_huge_str_32b
pickled = self.dumps(data, protocol=proto)
  File /opt/python-bigmem/3.x.langa-bigmem/build/Lib/test/test_pickle.py, 
line 49, in dumps
return pickle.dumps(arg, protocol)
MemoryError

--

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



[issue13072] Getting a buffer from a Unicode array uses invalid format

2012-08-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 4ee4cceda047 by Victor Stinner in branch 'default':
Issue #13072: Fix test_array for installation without the ctypes module
http://hg.python.org/cpython/rev/4ee4cceda047

--

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



[issue15594] test_copyfile_named_pipe() fails on Mac OS X Snow Leopard: OSError: [Errno 22] Invalid argument

2012-08-08 Thread STINNER Victor

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


--
nosy: +hynek

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Stefan Krah

Stefan Krah added the comment:

As for the original error: in test_subprocess basically every test
fails. With the standard regrtest.py (faulthandler enabled), most
tests generate a bus error in subprocess_fork_exec():


621 cwd_obj2 = NULL;
(gdb) 
624 pid = fork();  - bus error
(gdb) 
Fatal Python error: Bus error

Current thread 0x4000:
  File /home/user/cpython/Lib/subprocess.py, line 1363 in _execute_child
  File /home/user/cpython/Lib/subprocess.py, line 818 in __init__
  File /home/user/cpython/Lib/test/test_subprocess.py, line 728 in 
test_bufsize_is_none





621 cwd_obj2 = NULL;
(gdb) 
624 pid = fork();  - bus error
(gdb) 
Fatal Python error: Bus error

Current thread 0x4000:
  File /home/user/cpython/Lib/subprocess.py, line 1363 in _execute_child
  File /home/user/cpython/Lib/subprocess.py, line 818 in __init__
  File /home/user/cpython/Lib/test/test_subprocess.py, line 728 in 
test_bufsize_is_none


With all faulthandler references removed from regrtest.py no
bus errors happen, but most tests fail anyway. As I said, I'm
NOT blaming faulthandler, but suspect some strange platform
bug that perhaps involves linuxthreads.


Since Floris can't reproduce this error, I'm setting the priority
to normal.

--
priority: critical - normal

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



[issue15597] exception __suppress_context__ test failures on OS X ppc systems

2012-08-08 Thread Ned Deily

New submission from Ned Deily:

== CPython 3.3.0b1 (default:efb30bdcfa1e, Aug 8 2012, 15:43:49) [GCC 4.0.1 
(Apple Inc. build 5493)]
==   Darwin-8.11.0-Power_Macintosh-powerpc-32bit big-endian
==   /private/tmp/test_python_13864
Testing with flags: sys.flags(debug=0, inspect=0, interactive=0, optimize=0, 
dont_write_bytecode=0, no_user_site=0, no_site=0, ignore_environment=0, 
verbose=0, bytes_warning=0, quiet=0, hash_randomization=1)
[...]
==
FAIL: testChainingDescriptors (test.test_exceptions.ExceptionTests)
--
Traceback (most recent call last):
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/test/test_exceptions.py,
 line 432, in testChainingDescriptors
self.assertTrue(e.__suppress_context__)
AssertionError: False is not true

--

Other similar test failures include multiple test cases in test_ipaddress, 
test_raise, and test_traceback, for example:


==
FAIL: test_address_errors (test.test_ipaddress.NetworkTestCase_v6)
--
Traceback (most recent call last):
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/ipaddress.py, 
line 1580, in _ip_int_from_string
ip_int |= self._parse_hextet(parts[i])
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/ipaddress.py, 
line 1605, in _parse_hextet
raise ValueError(Only hex digits permitted in %r % hextet_str)
ValueError: Only hex digits permitted in 'axy'

During handling of the above exception, another exception occurred:

ipaddress.AddressValueError: Only hex digits permitted in 'axy' in '1234:axy::b'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/test/test_ipaddress.py,
 line 439, in test_address_errors
assertBadAddress(1234:axy::b, Only hex digits)
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/test/test_ipaddress.py,
 line 432, in assertBadAddress
self.factory(addr)
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/contextlib.py,
 line 66, in __exit__
self.gen.throw(type, value, traceback)
  File 
/Library/Frameworks/Python.framework/Versions/3.3/lib/python3.3/test/test_ipaddress.py,
 line 50, in assertCleanError
self.assertTrue(exc.exception.__suppress_context__)
AssertionError: False is not true

The same universal build runs without error on an Intel Mac with the same os 
version.  The ppc failures are seen on both PPC OS X 10.5 and 10.4 systems.

--
messages: 167734
nosy: benjamin.peterson, ned.deily, pitrou
priority: critical
severity: normal
stage: needs patch
status: open
title: exception __suppress_context__ test failures on OS X ppc systems
type: behavior
versions: Python 3.3

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



[issue15595] subprocess.Popen(universal_newlines=True) does not work for certain locales

2012-08-08 Thread STINNER Victor

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


--
nosy: +loewis

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Floris Bruynooghe

Floris Bruynooghe added the comment:

I can now confirm the whole testsuite runs, so the BusError part seems fixed on 
my host:

329 tests OK.
7 tests failed:
test_cmd_line test_exceptions test_ipaddress test_os test_raise
test_socket test_traceback
1 test altered the execution environment:
test_site
32 tests skipped:
test_codecmaps_cn test_codecmaps_hk test_codecmaps_jp
test_codecmaps_kr test_codecmaps_tw test_curses test_dbm_gnu
test_epoll test_gdb test_kqueue test_lzma test_msilib
test_ossaudiodev test_pep277 test_readline test_smtpnet
test_socketserver test_sqlite test_ssl test_startfile test_tcl
test_timeout test_tk test_ttk_guionly test_ttk_textonly
test_unicode_file test_urllib2net test_urllibnet test_winreg
test_winsound test_xmlrpc_net test_zipfile64
8 skips unexpected on sunos5:
test_lzma test_readline test_smtpnet test_ssl test_tcl test_tk
test_ttk_guionly test_ttk_textonly

--

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread Stefan Krah

Stefan Krah added the comment:

 329 tests OK.
 7 tests failed:
 test_cmd_line test_exceptions test_ipaddress test_os test_raise
 test_socket test_traceback

Thanks. A lot of these appear to be big-endian related, see #15597.

--

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



[issue15597] exception __suppress_context__ test failures on OS X ppc systems

2012-08-08 Thread STINNER Victor

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


--
nosy: +haypo

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



[issue15589] Bus error on Debian sparc

2012-08-08 Thread STINNER Victor

STINNER Victor added the comment:

 With all faulthandler references removed from regrtest.py no
 bus errors happen, but most tests fail anyway. As I said, I'm
 NOT blaming faulthandler, but suspect some strange platform
 bug that perhaps involves linuxthreads.

Threads + signal is a very complex problem. It is not solved yet in OpenBSD for 
example. There were a lot of such issues on old versions of FreeBSD. Extract of 
the Wikipedia article of LinuxThreads:

LinuxThreads had a number of problems, mainly owing to the implementation, 
which used the clone system call to create a new process sharing the parent's 
address space. For example, threads had distinct process identifiers, causing 
problems for signal handling; (...)

If disabling faulthandler avoids new issues, you can add 'if 
sys.thread_info.version.startswith(linuxthreads): on the line:

faulthandler.enable(all_threads=True)

in regrtest.py.

I added sys.thread_info to be able to skip some tests only failing on 
LinuxThreads...

--

 but most tests fail anyway

Ah? With which message? Can you get more information in gdb?

--

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



[issue15597] exception __suppress_context__ test failures on OS X ppc systems

2012-08-08 Thread Ned Deily

Ned Deily added the comment:

It appears similar failures are occuring on Sparc platforms (see issue15589) 
another big-endian platform.

--

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



[issue15597] exception __suppress_context__ test failures on OS X ppc systems

2012-08-08 Thread Ned Deily

Changes by Ned Deily n...@acm.org:


--
nosy: +georg.brandl

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



[issue15597] exception __suppress_context__ test failures on OS X ppc systems

2012-08-08 Thread Benjamin Peterson

Benjamin Peterson added the comment:

Does this fix it?

--
keywords: +patch
Added file: http://bugs.python.org/file26731/char.patch

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



[issue15597] exception __suppress_context__ test failures on OS X ppc systems

2012-08-08 Thread STINNER Victor

STINNER Victor added the comment:

__suppress_context__ is a member using T_BOOL type. T_BOOL expects the C type 
char, whereas the field in the PyBaseExceptionObject is a C int. Attached 
patch changes the type and should fix the issue.

The test fails because writing into the field uses:

 *(char*)field = value;

Which does not work in big endian if the field is a pointer to an int.

--
Added file: http://bugs.python.org/file26732/exception.patch

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



[issue15595] subprocess.Popen(universal_newlines=True) does not work for certain locales

2012-08-08 Thread STINNER Victor

STINNER Victor added the comment:

There is a bug, but I'm not conviced that multibyte encodings are used as 
locale encoding.

About your patch: you should test the 3 types of newlines, so use a string 
like: '1\r\n2\r3\n4'.

+# Popen() defaults to locale.getpreferredencoding(False).
+locale.getpreferredencoding = lambda do_setlocale: 'utf-16'

FYI it's not directly Popen() which uses the locale encoding, but TextIOWrapper.

--

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



[issue15598] relative import unexpectedly binds name

2012-08-08 Thread Antony Lee

New submission from Antony Lee:

The language reference is clear:
The from form does not bind the module name (Section 6.12)

However, consider the following example:

* package/__init__.py:
foo = FOO
from .foo import bar
print(foo)
os = OS
from os import path
print(os)

* package/foo.py:
foo = 42

Now import package results in printing:
module 'pypackage.foo' from 'pypackage/foo.py'
OS

i.e., the relative from ... import has not only bound bar, but also foo, 
which seems to contradict the documentation.
(I get the same behaviour using 3.2.3 as well as 2.7.3.)

--
messages: 167742
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: relative import unexpectedly binds name
versions: Python 3.2

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



[issue15598] relative import unexpectedly binds name

2012-08-08 Thread STINNER Victor

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


--
nosy: +brett.cannon

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



[issue15597] exception __suppress_context__ test failures on OS X ppc systems

2012-08-08 Thread Roundup Robot

Roundup Robot added the comment:

New changeset e2df976b8a33 by Benjamin Peterson in branch 'default':
use char instead of int to please T_BOOL (closes #15597)
http://hg.python.org/cpython/rev/e2df976b8a33

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

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



[issue15595] subprocess.Popen(universal_newlines=True) does not work for certain locales

2012-08-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Thanks for your comments.  

 FYI it's not directly Popen() which uses the locale encoding, but 
 TextIOWrapper.

Yes, I will note that to be more clear.  Would you like me to add tests for 
UTF-16-LE, etc. (via a helper test method), or will UTF-16 alone suffice?

--

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



[issue15595] subprocess.Popen(universal_newlines=True) does not work for certain locales

2012-08-08 Thread STINNER Victor

STINNER Victor added the comment:

 Would you like me to add tests for UTF-16-LE, etc. (via a helper test 
 method), or will UTF-16 alone suffice?

You can use a loop insteadd of an helper function.

I fail to see other encoding having the same issue, except the UTF-32 family 
(utf-32, utf-32-le, utf-32-be).

I don't think that writing a test for the 6 codecs is required, you can use 
utf-16 and utf-32-be. So you test without BOM and with BOM, and utf-16 and 
utf-32.

--

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



[issue15598] relative import unexpectedly binds name

2012-08-08 Thread Benjamin Peterson

Benjamin Peterson added the comment:

I don't think this is incorrect. Importing a submodule implicit sets its name 
in the package scope, which is __init__'s module scope.

--
nosy: +benjamin.peterson

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



[issue15599] test_circular_imports() of test_threaded_import fails on FreeBSD 9.0

2012-08-08 Thread STINNER Victor

New submission from STINNER Victor:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%209.0%203.x/builds/3231/steps/test/logs/stdio

[111/369] test_threaded_import
test_circular_imports (test.test_threaded_import.ThreadedImportTests) ... 
Exception in thread Thread-586:
Traceback (most recent call last):
  File /usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/threading.py, 
line 639, in _bootstrap_inner
self.run()
  File /usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/threading.py, 
line 596, in run
self._target(*self._args, **self._kwargs)
  File 
/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/test_threaded_import.py,
 line 194, in import_ab
import A
ImportError: No module named 'A'

Exception in thread Thread-587:
Traceback (most recent call last):
  File /usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/threading.py, 
line 639, in _bootstrap_inner
self.run()
  File /usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/threading.py, 
line 596, in run
self._target(*self._args, **self._kwargs)
  File 
/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/test_threaded_import.py,
 line 197, in import_ba
import B
ImportError: No module named 'B'

FAIL
test_import_hangers (test.test_threaded_import.ThreadedImportTests) ... ok
test_parallel_meta_path (test.test_threaded_import.ThreadedImportTests) ... 
Trying 20 threads ... OK.
Trying 50 threads ... OK.
Trying 20 threads ... OK.
Trying 50 threads ... OK.
Trying 20 threads ... OK.
Trying 50 threads ... OK.
ok
test_parallel_module_init (test.test_threaded_import.ThreadedImportTests) ... 
Trying 20 threads ... OK.
Trying 50 threads ... OK.
Trying 20 threads ... OK.
Trying 50 threads ... OK.
Trying 20 threads ... OK.
Trying 50 threads ... OK.
ok
test_parallel_path_hooks (test.test_threaded_import.ThreadedImportTests) ... 
Trying 20 threads ... OK.
Trying 50 threads ... OK.
Trying 20 threads ... OK.
Trying 50 threads ... OK.
Trying 20 threads ... OK.
Trying 50 threads ... OK.
ok
test_side_effect_import (test.test_threaded_import.ThreadedImportTests) ... ok

==
FAIL: test_circular_imports (test.test_threaded_import.ThreadedImportTests)
--
Traceback (most recent call last):
  File 
/usr/home/buildbot/buildarea/3.x.krah-freebsd/build/Lib/test/test_threaded_import.py,
 line 205, in test_circular_imports
self.assertEqual(set(results), {'a', 'b'})
AssertionError: Items in the second set but not the first:
'a'
'b'

--

--
messages: 167747
nosy: brett.cannon, haypo
priority: normal
severity: normal
status: open
title: test_circular_imports() of test_threaded_import fails on FreeBSD 9.0

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



[issue15595] subprocess.Popen(universal_newlines=True) does not work for certain locales

2012-08-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

Updating patch with Victor's comments.

--
Added file: http://bugs.python.org/file26733/issue-15595-2.patch

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



[issue15597] exception __suppress_context__ test failures on OS X ppc systems

2012-08-08 Thread Ned Deily

Ned Deily added the comment:

The patch does indeed fix all of the __suppress_context__ related test failures 
previously seen, i.e. test_exceptions, test_ipaddress, test_raise, and 
test_traceback.

--

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



[issue15595] subprocess.Popen(universal_newlines=True) does not work for certain locales

2012-08-08 Thread Chris Jerdonek

Chris Jerdonek added the comment:

It looks like this also affects 3.2, but I will need to modify the test 
slightly because in 3.2, TextIOWrapper calls locale.getpreferredencoding() 
without any arguments.

--
versions: +Python 3.2

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



  1   2   >