[issue9315] The trace module lacks unit tests

2010-09-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> It looks like 3.1 with computed gotos produces the yet another different 
> tracing of list comprehensions:
> 
> 
> 2: l = [i for
>10:  i in
> 1:  range(10)]

Well, this kind of thing is going to depend on the exact bytecode, the
way the evaluation loop is written, etc. That's why I would suggest
checking that the number of traced iterations is between, e.g. 10 (since
it's the number of loop iterations) and 15 (to account for any
additional "iterations" due to various inner jumps in the bytecode.

--

___
Python tracker 

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



[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

You should make sure that all operations (except close() itself) raise 
ValueError. Currently:

>>> f = gzip.open("test.gz", "rb")
>>> f.close()
>>> f.read()
b''
>>> f.seek(0)
0

Also, you don't have to post a patch for 2.7. We'll do the porting ourselves.
Thanks for contributing!

--
stage: needs patch -> patch review

___
Python tracker 

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



[issue9315] The trace module lacks unit tests

2010-09-15 Thread teresap989

teresap989  added the comment:

I was about to commit issue9315.3.patch, which is a lightly modified version of 
issue9315.2.patch, but it turned out that test_trace cannot be run by 
regrtest.py:

$ ./python.exe Lib/test/regrtest.py test_trace
test_trace
test test_trace failed -- multiple errors occurred; run in verbose mode for 
details
1 test failed:
test_trace



__
[url=http://moviesonlineworld.com]watch free movies online[/url]

--
nosy: +teresap989

___
Python tracker 

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



[issue9315] The trace module lacks unit tests

2010-09-15 Thread Eli Bendersky

Eli Bendersky  added the comment:

Is it really *interesting* to trace separate parts of list comprehensions
like this? What would one want to do that? The only idea I have in mind of
perhaps for comprehensions containing 'if's, to know how many times the
comprehension was actually executed.

In any case, this indeed depends quite a lot on the internal representation
of comprehensions.

--
Added file: http://bugs.python.org/file1/unnamed

___
Python tracker 

___
> It looks like 3.1 with computed gotos produces the yet another different 
tracing of list comprehensions:
>
>
>     2: l = [i for
>    10:      i in
>     1:      range(10)]

Well, this kind of thing is going to depend on the exact bytecode, the
way the evaluation loop is written, etc. That's why I would suggest
checking that the number of traced iterations is between, e.g. 10 (since
it's the number of loop iterations) and 15 (to account for any
additional "iterations" due to various inner jumps in the 
bytecode.
Is it really *interesting* to 
trace separate parts of list comprehensions like this? What would one want to 
do that? The only idea I have in mind of perhaps for comprehensions containing 
'if's, to know how many times the comprehension was actually 
executed.

In any case, this indeed depends quite a lot on the internal representation 
of comprehensions.
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9315] The trace module lacks unit tests

2010-09-15 Thread Antoine Pitrou

Changes by Antoine Pitrou :


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

___
Python tracker 

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



[issue9858] RawIOBase doesn't define readinto

2010-09-15 Thread Antoine Pitrou

New submission from Antoine Pitrou :

RawIOBase is defined as having the readinto() method but it doesn't. It should 
at least have a failing one (raising io.UnsupportedOperation like the 
BufferedIOBase.{read,readinto} methods do).

This is, of course, mainly for auto-documenting purposes (with help() and 
friends).

--
components: IO
keywords: easy
messages: 116440
nosy: pitrou
priority: low
severity: normal
stage: needs patch
status: open
title: RawIOBase doesn't define readinto
type: behavior
versions: Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

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



[issue9858] RawIOBase doesn't define readinto

2010-09-15 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +benjamin.peterson, stutzbach

___
Python tracker 

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



[issue9857] SkipTest in tearDown is reported an as an error

2010-09-15 Thread Michael Foord

Michael Foord  added the comment:

Interesting use case.

If the test has not yet failed this is fine. The problem is that if an 
exception has *already* been raised then it will already have been added to the 
result - so by then skipping is meaningless (or contradictory - the test can 
fail *and* skip).

--

___
Python tracker 

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



[issue9858] RawIOBase doesn't define readinto

2010-09-15 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

+1 for a failing one. (Does the base implementation not raise?)

Is it even possible to implement a real one without buffering?

--

___
Python tracker 

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



[issue9858] RawIOBase doesn't define readinto

2010-09-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> +1 for a failing one. (Does the base implementation not raise?)

The base implementation doesn't exist :)

> Is it even possible to implement a real one without buffering?

FileIO does. It's the same as read(), except that you read into an existing 
buffer rather than allocating a new bytes object.

--

___
Python tracker 

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



[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

Attached is a script to find all of the mismatches between the C and Python 
implementations.  There are several.  Below is the output:

RawIOBase C is missing: ['readinto', 'write']
StringIO C is missing: ['name']
StringIO python is missing: ['__getstate__', '__setstate__']
BufferedRandom python is missing: ['raw']
BlockingIOError python is missing: ['characters_written']
TextIOWrapper python is missing: ['buffer']
BufferedReader python is missing: ['raw']
BufferedWriter python is missing: ['raw']
BytesIO python is missing: ['__setstate__']

Since the Python version was the original reference implementation, adding the 
attributes missing from the C side seems to be a straightforward decision (and 
it should simply match whatever the Python version does).  It looks like a 
number of new attributes have creeped into the C side, which will require more 
thoughtful decision making.

We should probably double-check that each of these is documented, while we're 
at it.

--
priority: low -> normal
resolution:  -> accepted
title: RawIOBase doesn't define readinto -> Python and C implementations of io 
are out of sync
Added file: http://bugs.python.org/file18889/missing_methods.py

___
Python tracker 

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



[issue9859] Add tests to verify API match of modules with 2 implementations

2010-09-15 Thread Daniel Stutzbach

New submission from Daniel Stutzbach :

Recently it came to light that the classes in C and Python implementations of 
the io module have slightly different attributes (issue9858).  I propose the 
addition of a helper function in Lib/test/support.py to verify that the classes 
in two different implementations define the same attributes.  Then, we can add 
tests to use that function to verify that C and Python implementations define 
the same API (for the io module, but also for other modules where we have two 
implementations).  The script I added to issue9858 could serve as a starting 
point for such a function.

Since CPython's standard library is the de facto reference implementation, it's 
important that it define one API and not two slightly different ones. :-)

--
components: Tests
messages: 116445
nosy: stutzbach
priority: low
severity: normal
stage: needs patch
status: open
title: Add tests to verify API match of modules with 2 implementations
type: feature request
versions: Python 3.2

___
Python tracker 

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



[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

FWIW, I just opened Issue9859: Add tests to verify API match of modules with 2 
implementations.

--

___
Python tracker 

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



[issue9851] multiprocessing socket timeout will break client

2010-09-15 Thread Jesse Noller

Jesse Noller  added the comment:

Calling it stupid doesn't incentivize me to help you, or fix it.

--

___
Python tracker 

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



[issue9857] SkipTest in tearDown is reported an as an error

2010-09-15 Thread Raghuram Devarakonda

Changes by Raghuram Devarakonda :


--
nosy: +draghuram

___
Python tracker 

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



[issue9860] Building python outside of source directory fails

2010-09-15 Thread Alexander Belopolsky

New submission from Alexander Belopolsky :

When testing config options, it is often useful to build python in a directory 
different from the root of the source tree.  This is supported by autoconf 
based builds as follows: you cd to the desired directory run configure with an 
explicit path. For example:

$ cd ../altdir
$ ../python-source/configure
$ make

However, this fails for python 3.1 and 3.2 with the following error:


i686-apple-darwin10-gcc-4.2.1: Parser/tokenizer_pgen.o: No such file or 
directory
i686-apple-darwin10-gcc-4.2.1: Parser/printgrammar.o: No such file or directory
i686-apple-darwin10-gcc-4.2.1: Parser/pgenmain.o: No such file or directory
make: *** [Parser/pgen] Error 1

--
assignee: belopolsky
components: Interpreter Core
messages: 116448
nosy: belopolsky
priority: normal
severity: normal
stage: needs patch
status: open
title: Building python outside of source directory fails
type: compile error
versions: Python 3.1, Python 3.2

___
Python tracker 

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



[issue678264] test_resource fails when file size is limited

2010-09-15 Thread R. David Murray

R. David Murray  added the comment:

The test does not fail if FSIZE is not max on linux/py3k, but max is still 
represented as -1 on linux.  So the reported bug is no longer valid, but 
Martin's concern has not been addressed.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue9861] subprocess module changed exposed attributes

2010-09-15 Thread paul clinch

New submission from paul clinch :

Some attributes, e.g. STARTF_USESHOWWINDOW have moved to 
_subrocess.STARTF_USESHOWWINDOW. This breaks old code.

--
components: Library (Lib)
messages: 116450
nosy: pclinch
priority: normal
severity: normal
status: open
title: subprocess module changed exposed attributes
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue9860] Building python outside of source directory fails

2010-09-15 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I think the problem is with the following explicit rules in Makefile:


Parser/tokenizer_pgen.o:$(srcdir)/Parser/tokenizer.c

Parser/pgenmain.o:  $(srcdir)/Include/parsetok.h

It looks like these rules are not VPATH friendly.  Per Antoine's suggestions, 
adding build experts to the nosy list.

--
nosy: +dmalcolm, doko

___
Python tracker 

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



[issue9859] Add tests to verify API match of modules with 2 implementations

2010-09-15 Thread R. David Murray

R. David Murray  added the comment:

Shouldn't the test suite catch such discrepancies by testing all of the API?  
So your script catching something would be the equivalent of "oops, we forgot a 
test" (or "oops, this name shouldn't be public").  Which is not a bad thing to 
have as part of the test suite.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue9859] Add tests to verify API match of modules with 2 implementations

2010-09-15 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

Yes, exactly. :-)

(see also Issue9731, which has a similar flavor)

--

___
Python tracker 

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



[issue9516] sysconfig: $MACOSX_DEPLOYMENT_TARGET mismatch: now "10.3" but "10.5" during configure

2010-09-15 Thread Stonewall Ballard

Stonewall Ballard  added the comment:

I just ran into this with Python 2.7, installed using port. I'm using python to 
process a text file in an Xcode 3.2 Script build step, and it's throwing the 
error because my Xcode target has a base sdk of 10.5.

--
nosy: +stoneyb

___
Python tracker 

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



[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2010/9/15 Daniel Stutzbach :
>
> Daniel Stutzbach  added the comment:
>
> Attached is a script to find all of the mismatches between the C and Python 
> implementations.  There are several.  Below is the output:
>
> BufferedRandom python is missing: ['raw']
> TextIOWrapper python is missing: ['buffer']
> BufferedReader python is missing: ['raw']
> BufferedWriter python is missing: ['raw']

These attributes exist; they're just not properties.

--

___
Python tracker 

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



[issue9860] Building python outside of source directory fails

2010-09-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

It works here (Linux). Did you try make distclean first? Also, try to remove 
the various files created by configure.

(what is VPATH?)

--
nosy: +pitrou

___
Python tracker 

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



[issue6884] Impossible to include file in sdist that starts with 'build' on Win32

2010-09-15 Thread Chris Withers

Chris Withers  added the comment:

So, the workaround I gave doesn't work, because this stupid regex still knocks 
out all the egg-info. The only solution is to use that accidentally employed by 
http://svn.plone.org/svn/collective/buildout/buildout.dumppickedversions/trunk/ 
and put any files starting with 'build' and that need to be used on Windows in 
a sub-folder.

Here's a debug sdist build dump from buildout.dumppickedversions:

Running setup script 'setup.py'.
Distribution.parse_config_files():
options (after parsing config files):
no commands known yet
options (after parsing command line):
option dict for 'aliases' command:
  {}
option dict for 'sdist' command:
  {}
running sdist
Distribution.get_command_obj(): creating 'sdist' command object
running egg_info
Distribution.get_command_obj(): creating 'egg_info' command object
writing requirements to src\buildout.dumppickedversions.egg-info\requires.txt
writing src\buildout.dumppickedversions.egg-info\PKG-INFO
writing namespace_packages to 
src\buildout.dumppickedversions.egg-info\namespace_packages.txt
writing top-level names to 
src\buildout.dumppickedversions.egg-info\top_level.txt
writing dependency_links to 
src\buildout.dumppickedversions.egg-info\dependency_links.txt
writing entry points to 
src\buildout.dumppickedversions.egg-info\entry_points.txt
Distribution.get_command_obj(): creating 'build_py' command object
Distribution.get_command_obj(): creating 'build' command object
include_pattern: applying regex 
r'^src\\buildout\.dumppickedversions\.egg\-info\.*[^/]*\Z(?ms)'
 adding src\buildout.dumppickedversions.egg-info\dependency_links.txt
 adding src\buildout.dumppickedversions.egg-info\entry_points.txt
 adding src\buildout.dumppickedversions.egg-info\namespace_packages.txt
 adding src\buildout.dumppickedversions.egg-info\not-zip-safe
 adding src\buildout.dumppickedversions.egg-info\PKG-INFO
 adding src\buildout.dumppickedversions.egg-info\requires.txt
 adding src\buildout.dumppickedversions.egg-info\SOURCES.txt
 adding src\buildout.dumppickedversions.egg-info\top_level.txt
exclude_pattern: applying regex r'^build\.*'
 removing buildout.cfg
exclude_pattern: applying regex r'^buildout\.dumppickedversions\-0\.5\.*'
...

Now contrast with buildout_versions:

Running setup script 'setup.py'.
Distribution.parse_config_files():
options (after parsing config files):
no commands known yet
options (after parsing command line):
option dict for 'aliases' command:
  {}
option dict for 'sdist' command:
  {}
running sdist
Distribution.get_command_obj(): creating 'sdist' command object
running egg_info
Distribution.get_command_obj(): creating 'egg_info' command object
writing requirements to buildout_versions.egg-info\requires.txt
writing buildout_versions.egg-info\PKG-INFO
writing top-level names to buildout_versions.egg-info\top_level.txt
writing dependency_links to buildout_versions.egg-info\dependency_links.txt
writing entry points to buildout_versions.egg-info\entry_points.txt
Distribution.get_command_obj(): creating 'build_py' command object
Distribution.get_command_obj(): creating 'build' command object
include_pattern: applying regex r'^buildout\_versions\.egg\-info\.*[^/]*\Z(?ms)'
 adding buildout_versions.egg-info\dependency_links.txt
 adding buildout_versions.egg-info\entry_points.txt
 adding buildout_versions.egg-info\not-zip-safe
 adding buildout_versions.egg-info\PKG-INFO
 adding buildout_versions.egg-info\requires.txt
 adding buildout_versions.egg-info\SOURCES.txt
 adding buildout_versions.egg-info\top_level.txt
exclude_pattern: applying regex r'^build\.*'
 removing buildout_versions.egg-info\top_level.txt
 removing buildout_versions.egg-info\SOURCES.txt
 removing buildout_versions.egg-info\requires.txt
 removing buildout_versions.egg-info\PKG-INFO
 removing buildout_versions.egg-info\not-zip-safe
 removing buildout_versions.egg-info\entry_points.txt
 removing buildout_versions.egg-info\dependency_links.txt
 removing buildout.cfg
 removing buildout_versions.egg-info\SOURCES.txt
exclude_pattern: applying regex r'^buildout\-versions\-1\.4\.*'

--

___
Python tracker 

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



[issue9860] Building python outside of source directory fails

2010-09-15 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

It turns out that make only gets confused when target files (Parser/pgenmain.o 
etc.) exist in the source directory.  Thus an obvious workaround is to build 
all versions in alternative directories or delete object files from source tree 
before alternative builds.

This is still fragile and does not explain why for some targets, VPATH 
candidates are ignored and for some are not.

--
priority: normal -> low

___
Python tracker 

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



[issue9860] Building python outside of source directory fails

2010-09-15 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

> (what is VPATH?)

VPATH is a search path that make uses to find targets and prerequisites.  
configure sets it to its own location when invoked from a directory other than 
cwd.

--

___
Python tracker 

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



[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

> These attributes exist; they're just not properties.

Yes, I see.  They're added to the instance in the constructor, so they don't 
exist as attributes of the class.  Also in that category:

BlockingIOError python is missing: ['characters_written']

That leaves:

RawIOBase C is missing: ['readinto', 'write']
StringIO C is missing: ['name']
StringIO python is missing: ['__getstate__', '__setstate__']
BytesIO python is missing: ['__setstate__']

The Python version of StringIO throws an AttributeException on the .name 
attribute.  It's a property inherited from the TextIOWrapper.  Effectively, 
TextIOWrapper provides the .name attribute if the object that it's wrapping 
provides the .name attribute.  This behavior is undocumented.

Is that reasonable behavior?  Or should TextIOWrapper define .name always and 
return some suitable value if the wrapped object doesn't define .name? (e.g., 
None)

In any case, it needs documentation.

--

___
Python tracker 

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



[issue6884] Impossible to include file in sdist that starts with 'build' on Win32

2010-09-15 Thread Chris Withers

Chris Withers  added the comment:

Okay, so here's the patch:

Change line 352 on distutils/filelist.py from:

pattern_re = "^" + os.path.join(prefix_re, ".*" + pattern_re)

To:

pattern_re = "^"+prefix_re+re.escape(os.sep)+".*"+pattern_re

os.path.join is is not always the saviour ;-)

--
keywords: +needs review -patch

___
Python tracker 

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



[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2010/9/15 Daniel Stutzbach :
>
> Daniel Stutzbach  added the comment:
>
>> These attributes exist; they're just not properties.
>
> Yes, I see.  They're added to the instance in the constructor, so they don't 
> exist as attributes of the class.  Also in that category:
>
> BlockingIOError python is missing: ['characters_written']
>
> That leaves:
>
> RawIOBase C is missing: ['readinto', 'write']
> StringIO C is missing: ['name']
> StringIO python is missing: ['__getstate__', '__setstate__']
> BytesIO python is missing: ['__setstate__']

I'm not sure if this pickling stuff matters as long as they both pickle.

>
> The Python version of StringIO throws an AttributeException on the .name 
> attribute.  It's a property inherited from the TextIOWrapper.  Effectively, 
> TextIOWrapper provides the .name attribute if the object that it's wrapping 
> provides the .name attribute.  This behavior is undocumented.
>
> Is that reasonable behavior?  Or should TextIOWrapper define .name always and 
> return some suitable value if the wrapped object doesn't define .name? (e.g., 
> None)

Yes, all the code expects an AttributeError on name is it's not
present. For example, FileIO only sets its name attribute if it is
passed a filename and not an fd.

--

___
Python tracker 

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



[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

On Wed, Sep 15, 2010 at 10:51 AM, Benjamin Peterson
wrote:

> I'm not sure if this pickling stuff matters as long as they both pickle.
>

I'm not sure either.  Do other Python implementations try to maintain a
compatible pickle format with CPython?  If so, I think CPython's C and
Python versions should also pickle to the same format.

> Yes, all the code expects an AttributeError on name is it's not
> present. For example, FileIO only sets its name attribute if it is
> passed a filename and not an fd.
>

Actually, FileIO sets the name attribute to the file descriptor if it isn't
passed a name:

1

--
Added file: http://bugs.python.org/file18890/unnamed

___
Python tracker 

___On Wed, Sep 15, 2010 at 10:51 AM, Benjamin Peterson 
rep...@bugs.python.org> 
wrote:

I'm not sure if this pickling stuff matters as long as they both 
pickle.I'm not sure either.  Do other Python 
implementations try to maintain a compatible pickle format with CPython?  If 
so, I think CPython's C and Python versions should also pickle to the same 
format.
 
Yes, all the code expects an AttributeError on name is it's not
present. For example, FileIO only sets its name attribute if it is
passed a filename and not an fd.Actually, FileIO sets 
the name attribute to the file descriptor if it isn't passed a 
name:>>> f = io.FileIO(1)>>> http://f.name";>f.name
1
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach

Changes by Daniel Stutzbach :


Removed file: http://bugs.python.org/file18890/unnamed

___
Python tracker 

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



[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

Roundup does not play well with Gmail when Gmail is in Rich Format mode ;-)

That example should have read:

>>> f = io.FileIO(1)
>>> f.name
1

--

___
Python tracker 

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



[issue9315] The trace module lacks unit tests

2010-09-15 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


Removed file: http://bugs.python.org/file1/unnamed

___
Python tracker 

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



[issue1633863] AIX: configure ignores $CC

2010-09-15 Thread Sébastien Sablé

Sébastien Sablé  added the comment:

Antoine, I tested your commit with cc_r and it compiles fine (I have buildbot 
running now, just need to find a way to make the results publicly browsable).

I still think xlc_r would be a better choice as a default: at the moment ctypes 
will not compile on AIX, but cc_r will fail as soon as when it compiles 
_ctypes.c, while xlc_r will compile this file fine but fail later on 
libffi/src/powerpc/ffi.c

cc_r -qlanglvl=extc89 -DNDEBUG -O -O2 -O2 
-Ibuild/temp.aix-6.1-3.2/libffi/include -Ibuild/temp.aix-6.1-3.2/libffi 
-I/san_cis/home/cis/buildbot/buildbot-aix6/py3k/build/Modules/_ctypes/libffi/src
 -I. -I./Include -I/home/cis/buildbot/support-buildbot/include 
-I/home/cis/buildbot/support-buildbot/include/ncurses -I/usr/local/include 
-IInclude -I/san_cis/home/cis/buildbot/buildbot-aix6/py3k/build -c 
/san_cis/home/cis/buildbot/buildbot-aix6/py3k/build/Modules/_ctypes/_ctypes.c 
-o 
build/temp.aix-6.1-3.2/san_cis/home/cis/buildbot/buildbot-aix6/py3k/build/Modules/_ctypes/_ctypes.o
"build/temp.aix-6.1-3.2/libffi/include/ffi.h", line 133.27: 1506-207 (W) 
Integer constant 9223372036854775807 out of range.
"build/temp.aix-6.1-3.2/libffi/include/ffi.h", line 134.3: 1506-205 (S) #error 
"no 64-bit data type supported"
"/san_cis/home/cis/buildbot/buildbot-aix6/py3k/build/Modules/_ctypes/_ctypes.c",
 line 3222.27: 1506-068 (W) Operation between types "void*" and "int(*)(void)" 
is not allowed.
"/san_cis/home/cis/buildbot/buildbot-aix6/py3k/build/Modules/_ctypes/_ctypes.c",
 line 3766.31: 1506-280 (W) Function argument assignment between types 
"int(*)(void)" and "void*" is not allowed.
"/san_cis/home/cis/buildbot/buildbot-aix6/py3k/build/Modules/_ctypes/_ctypes.c",
 line 5386.63: 1506-280 (W) Function argument assignment between types "void*" 
and "void*(*)(void*,const void*,unsigned long)" is not allowed.
"/san_cis/home/cis/buildbot/buildbot-aix6/py3k/build/Modules/_ctypes/_ctypes.c",
 line 5387.62: 1506-280 (W) Function argument assignment between types "void*" 
and "void*(*)(void*,int,unsigned long)" is not allowed.
"/san_cis/home/cis/buildbot/buildbot-aix6/py3k/build/Modules/_ctypes/_ctypes.c",
 line 5388.65: 1506-280 (W) Function argument assignment between types "void*" 
and "struct _object*(*)(const char*,int)" is not allowed.
"/san_cis/home/cis/buildbot/buildbot-aix6/py3k/build/Modules/_ctypes/_ctypes.c",
 line 5389.60: 1506-280 (W) Function argument assignment between types "void*" 
and "struct _object*(*)(void*,struct _object*,struct _object*)" is not allowed.
"/san_cis/home/cis/buildbot/buildbot-aix6/py3k/build/Modules/_ctypes/_ctypes.c",
 line 5391.66: 1506-280 (W) Function argument assignment between types "void*" 
and "struct _object*(*)(const unsigned short*,int)" is not allowed.

--

___
Python tracker 

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



[issue9315] The trace module lacks unit tests

2010-09-15 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

> Is it really *interesting* to trace separate parts of list
> comprehensions like this?

It may or may not be useful for tracing code in the wild, but it helps to 
isolate the causes of count mismatches.

I am attaching a file, x.py, that shows differing behavior for 3.1 and 3.2 and 
with and without computed gotos in each version.

The traced code is


2 def f():
3 return [i
4 for i
5 in range(10)]

and the script prints the disassembly of f including the listcomp object.

The results are (s/g - with/without computed gotos):

3.1s: {('x.py', 3): 2, ('x.py', 5): 1}
3.1g: {('x.py', 4): 10, ('x.py', 3): 2, ('x.py', 5): 1}
3.2s: {('x.py', 3): 12, ('x.py', 5): 1}
3.2g: {('x.py', 4): 10, ('x.py', 3): 12, ('x.py', 5): 1}

Note that the bytecode is the same in all cases:

  3   0 LOAD_CONST   1 ( at 
0x1005250b8, file "x.py", line 3>) 
  3 MAKE_FUNCTION0 

  5   6 LOAD_GLOBAL  0 (range) 
  9 LOAD_CONST   2 (10) 
 12 CALL_FUNCTION1 
 15 GET_ITER 
 16 CALL_FUNCTION1 
 19 RETURN_VALUE 
listcomp:
  3   0 BUILD_LIST   0 
  3 LOAD_FAST0 (.0) 
>>6 FOR_ITER12 (to 21) 

  4   9 STORE_FAST   1 (i) 
 12 LOAD_FAST1 (i) 
 15 LIST_APPEND  2 
 18 JUMP_ABSOLUTE6 
>>   21 RETURN_VALUE

--

___
Python tracker 

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



[issue9862] test_subprocess hangs on AIX

2010-09-15 Thread Sébastien Sablé

New submission from Sébastien Sablé :

On AIX, the test test_communicate_pipe_buf in test_subprocess will hang forever 
(in py3k and py27):

test_communicate_pipe_buf (__main__.ProcessTestCase) ... 


  File "Lib/test/test_subprocess.py", line 386, in test_communicate_pipe_buf
(stdout, stderr) = p.communicate(string_to_write)
  File 
"/san_cis/home/cis/data/bamboo-home-agent-runtime/xml-data/build-dir/RTAIX30-SUP/Python-2.7-svn/Lib/subprocess.py",
 line 740, in communicate
return self._communicate(input)
  File 
"/san_cis/home/cis/data/bamboo-home-agent-runtime/xml-data/build-dir/RTAIX30-SUP/Python-2.7-svn/Lib/subprocess.py",
 line 1257, in _communicate
stdout, stderr = self._communicate_with_poll(input)
  File 
"/san_cis/home/cis/data/bamboo-home-agent-runtime/xml-data/build-dir/RTAIX30-SUP/Python-2.7-svn/Lib/subprocess.py",
 line 1320, in _communicate_with_poll
input_offset += os.write(fd, chunk)
KeyboardInterrupt

The comment in this test indicates:
  # communicate() with writes larger than pipe_buf
  # This test will probably deadlock rather than fail, if
  # communicate() does not work properly.

So I guess it means communicate() does not work properly on AIX.

--
components: Library (Lib)
messages: 116467
nosy: sable
priority: normal
severity: normal
status: open
title: test_subprocess hangs on AIX
versions: Python 2.7, Python 3.2

___
Python tracker 

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



[issue9315] The trace module lacks unit tests

2010-09-15 Thread Alexander Belopolsky

Changes by Alexander Belopolsky :


Added file: http://bugs.python.org/file18891/x.py

___
Python tracker 

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



[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2010/9/15 Daniel Stutzbach :
>
> Daniel Stutzbach  added the comment:
>
> Roundup does not play well with Gmail when Gmail is in Rich Format mode ;-)
>
> That example should have read:
>
 f = io.FileIO(1)
 f.name
> 1

Hmm, none the less other code expects it.

--

___
Python tracker 

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



[issue9315] The trace module lacks unit tests

2010-09-15 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I am attaching another test file, y.py, which shows that the cause of 
discrepancy is outside of the trace module. The traced function is the same as 
in x.py only with 5 iterations instead of 10 for brevity, but instead of using 
trace module, I am registering a custom trace function like this:

lines = []
def tracefunc(frame, what, arg):
if what == 'line':
lines.append(frame.f_lineno)
return tracefunc
sys.settrace(tracefunc)

3.1s: [3, 5, 3]
3.1g: [3, 5, 3, 4, 4, 4, 4, 4]
3.2s: [3, 5, 3, 3, 3, 3, 3, 3]
3.2g: [3, 5, 3, 4, 3, 4, 3, 4, 3, 4, 3, 4, 3]

Interestingly, this shows that effect of computed gotos is the same in 3.1 and 
3.2 - adding a line event from "for i" line.

This situation illustrates the reason why I wanted to use synthetic events to 
test the trace module rather than events generated by settrace  machinery.  
Apparently these differences have nothing to do with trace.py and everything 
with ceval.c.  If it is important to maintain stability of trace events between 
python versions, tests (with appropriate sensitivity) should be added to 
test_sys_setrace.

On the other hand, there are a lot of things that can go wrong in trace.py - 
extracting code information from frame, divining the method and class names 
etc.  Ideally, this logic should be tested without reliance on details of event 
generation.

--
Added file: http://bugs.python.org/file18892/y.py

___
Python tracker 

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



[issue9759] GzipFile object should raise ValueError on .read() after .close()

2010-09-15 Thread Jeffrey Finkelstein

Jeffrey Finkelstein  added the comment:

Here's the updated patch, which checks whether the file is closed on each call 
to read(), write(), and flush(), along with a test.

--
Added file: http://bugs.python.org/file18893/issue9759.patch

___
Python tracker 

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



[issue9854] SocketIO should return None on EWOULDBLOCK

2010-09-15 Thread Giampaolo Rodola'

Giampaolo Rodola'  added the comment:

> Non-blocking files exist

Of course, I should have been more clear.
What I meant is that there's no such thing as explicit and "native" as 
setblocking() for plain files.

> Returning None is what raw I/O objects are supposed to do when they 
> fail reading or writing even a single byte. It is designed and 
> documented as such.

>From http://docs.python.org/dev/library/io.html#module-io about 
>io.BufferedIOBase.readinto()

> A BlockingIOError is raised if the underlying raw stream is in non 
> blocking-mode, and has no data available at the moment.

This is valid for BufferedReader, BufferWriter and BufferIOBase classes in 
various methods while io.RawIOBase.write() and io.RawIOBase.read() return None 
instead. Shouldn't they raise BlockingIOError as well? Why do they return None?

--

___
Python tracker 

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



[issue9863] threading, signals, atexit: different execution with different versions

2010-09-15 Thread Corey Bertram

Changes by Corey Bertram :


--
nosy: cbertram
priority: normal
severity: normal
status: open
title: threading, signals, atexit: different execution with different versions
type: behavior
versions: Python 2.6

___
Python tracker 

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



[issue9863] threading, signals, atexit: different execution with different versions

2010-09-15 Thread Corey Bertram

New submission from Corey Bertram :

my code works on python 2.6.2 and fails to work on python 2.6.5. What's going 
on here?

import atexit, sys, signal, time, threading

terminate = False
threads = []

def test_loop():
while True:
if terminate:
print('stopping thread')
break
else:
print('looping')
time.sleep(1)

@atexit.register
def shutdown():
global terminate
print('shutdown detected')
terminate = True
for thread in threads:
thread.join()

def close_handler(signum, frame):
print('caught signal')
sys.exit(0)

def run():
global threads
thread = threading.Thread(target=test_loop)
thread.start()
threads.append(thread)

while True:
time.sleep(2)
print('main')

signal.signal(signal.SIGINT, close_handler)

if __name__ == "__main__":
run()


python 2.6.2:
$ python halp.py 
looping
looping
looping
main
looping
main
looping
looping
looping
main
looping
^Ccaught signal
shutdown detected
stopping thread

python 2.6.5:
$ python halp.py 
looping
looping
looping
main
looping
looping
main
looping
looping
main
^Ccaught signal
looping
looping
looping
looping
...
looping
looping
Killed <- kill -9 process at this point

The main thread on 2.6.5 appears to never execute the atexit functions.

--

___
Python tracker 

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



[issue9864] email.utils.{parsedate, parsedate_tz} should have better return types

2010-09-15 Thread Antoine Pitrou

New submission from Antoine Pitrou :

They both return raw tuples, which are not very intuitive to interpret:

>>> email.utils.parsedate_tz("Wed, 15 Sep 2010 09:53:50 -0700 (PDT)")
(2010, 9, 15, 9, 53, 50, 0, 1, -1, -25200)

It would be much better if they returned some kind of namedtuple, which would 
preserve backwards compatibility but with much better readability and usability.

Note that parsedate() could also return the existing time.struct_time type 
(which is compatible with a 9-tuple):
http://docs.python.org/library/time.html#time.struct_time

--
components: Library (Lib)
messages: 116473
nosy: barry, pitrou, r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: email.utils.{parsedate,parsedate_tz} should have better return types
type: feature request
versions: Python 3.2

___
Python tracker 

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



[issue9861] subprocess module changed exposed attributes

2010-09-15 Thread Giampaolo Rodola'

Changes by Giampaolo Rodola' :


--
nosy: +giampaolo.rodola

___
Python tracker 

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



[issue9864] email.utils.{parsedate, parsedate_tz} should have better return types

2010-09-15 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

+1

--

___
Python tracker 

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



[issue9864] email.utils.{parsedate, parsedate_tz} should have better return types

2010-09-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

By the way, while as mentioned in the docs “indexes 6, 7, and 8 of the result 
tuple are not usable”, perhaps it would be time to fix it? (at least for 6 and 
7, aka. wday and yday)

--

___
Python tracker 

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



[issue4761] create Python wrappers for openat() and others

2010-09-15 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +durban

___
Python tracker 

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



[issue9807] deriving configuration information for different builds with the same prefix

2010-09-15 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

@Martin: yep, I know we still need to install pyconfig.h and Makefile, but we 
shouldn't need to parse them to get programmatic access to the data they 
contain.

--

___
Python tracker 

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



[issue9746] All sequence types support .index and .count

2010-09-15 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +durban

___
Python tracker 

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



[issue9756] Crash with custom __getattribute__

2010-09-15 Thread Daniel Urban

Changes by Daniel Urban :


--
nosy: +durban

___
Python tracker 

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



[issue9854] SocketIO should return None on EWOULDBLOCK

2010-09-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> Of course, I should have been more clear.
> What I meant is that there's no such thing as explicit and "native" as
> setblocking() for plain files.

Indeed. It would probably be a nice addition, assuming it is portable
enough.

> > A BlockingIOError is raised if the underlying raw stream is in non 
> > blocking-mode, and has no data available at the moment.
> 
> This is valid for BufferedReader, BufferWriter and BufferIOBase
> classes in various methods while io.RawIOBase.write() and
> io.RawIOBase.read() return None instead. Shouldn't they raise
> BlockingIOError as well? Why do they return None?

Well, that's how it was decided when the new IO lib was designed.
See http://www.python.org/dev/peps/pep-3116/#non-blocking-i-o
(but this says that write() should return 0, while the FileIO
implementation returns None; I'd say that for consistency with read()
and readinto() returning None is the right thing).

--

___
Python tracker 

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



[issue9315] The trace module lacks unit tests

2010-09-15 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

Raymond asked on IRC why this work is being back-ported.  The answer is that it 
is being forward-ported rather than back-ported.  The trace module had no 
unittests in either 2.x or 3.x and was very buggy in 3.x.  Presumably, 2.x 
version saw more use and was likely to be more correct than 3.x, so we decided 
to start with adding unit tests to 2.7 and then port the tests to 3.x while 
fixing the bugs.  See msg34.

This does not necessarily mean that we need to include 3.1. It may be 
appropriate to limit what is going to 3.1 to tests that support bug fixes.

If nobody raises an objection, I am going to close this issue by removing list 
comprehension test from 3.1 and will open a separate "interpreter core" issue 
for line tracing inconsistencies.

--
nosy: +rhettinger

___
Python tracker 

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



[issue678264] test_resource fails when file size is limited

2010-09-15 Thread R. David Murray

R. David Murray  added the comment:

As a point of information, on my gentoo linux system without largefile support 
in the kernel, any value 4294967295 or above results in getrlimit reporting -1. 
 Any smaller value is set and reported as itself.  (If a sufficiently large 
value is passed in to setrlimit, an OverflowError results.)

--

___
Python tracker 

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



[issue9863] threading, signals, atexit: different execution with different versions

2010-09-15 Thread R. David Murray

R. David Murray  added the comment:

I can confirm this, and that it works on python2.5 (I don't have a 2.6.2 around 
to test).  It also has the looping behavior on 2.7 and 3.2.

Given the timing, I wonder if this is the result of the fix to issue 1722344.

(Note, I removed 2.6 because it doesn't receive bug fixes any more, only 
security fixes.)

--
nosy: +pitrou, r.david.murray
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6

___
Python tracker 

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



[issue9865] OrderedDict doesn't implement __sizeof__

2010-09-15 Thread Antoine Pitrou

New submission from Antoine Pitrou :

Ordered dicts pretend to have the memory consumption as dicts:

>>> import sys, collections
>>> sys.getsizeof({})
280
>>> sys.getsizeof(collections.OrderedDict())
280

--
components: Library (Lib)
messages: 116481
nosy: pitrou, rhettinger
priority: low
severity: normal
status: open
title: OrderedDict doesn't implement __sizeof__
type: behavior
versions: Python 3.2

___
Python tracker 

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



[issue9360] nntplib cleanup

2010-09-15 Thread Antoine Pitrou

Changes by Antoine Pitrou :


Added file: http://bugs.python.org/file18894/nntplib_cleanup4.patch

___
Python tracker 

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



[issue9866] Inconsistencies in tracing list comprehensions

2010-09-15 Thread Alexander Belopolsky

New submission from Alexander Belopolsky :

Attached test script, tracetest.py, prints disassembly followed by a trace of 
the following function:


1  def f():
2  return [i
3  for i
4  in range(2)]


With default configuration, the output is


  2   0 LOAD_CONST   1 ( at 
0x100484e00, file "tracetest.py", line 2>) 
  3 MAKE_FUNCTION0 

  4   6 LOAD_GLOBAL  0 (range) 
  9 LOAD_CONST   2 (2) 
 12 CALL_FUNCTION1 
 15 GET_ITER 
 16 CALL_FUNCTION1 
 19 RETURN_VALUE 
listcomp:
  2   0 BUILD_LIST   0 
  3 LOAD_FAST0 (.0) 
>>6 FOR_ITER12 (to 21) 

  3   9 STORE_FAST   1 (i) 
 12 LOAD_FAST1 (i) 
 15 LIST_APPEND  2 
 18 JUMP_ABSOLUTE6 
>>   21 RETURN_VALUE 
['2 0 LOAD_CONST', '4 6 LOAD_GLOBAL', '2 0 BUILD_LIST', '3 9 STORE_FAST', '2 6 
FOR_ITER', '3 9 STORE_FAST', '2 6 FOR_ITER']

but with configuration using --without-computed-gotos option, the disassembly 
is the same, but the trace is different:


['2 0 LOAD_CONST', '4 6 LOAD_GLOBAL', '2 0 BUILD_LIST', '2 6 FOR_ITER', '2 6 
FOR_ITER']

This behavior changed between 3.1 and 3.2 (likely in r74132), but it is 
inconsistent in both versions.  Since r74132 changes were not backported to 
3.1, I am classifying this as 3.2 only even though the problem is present in 
3.1 as well.

See also issues #6042 and #9315.

--
components: Interpreter Core
files: tracetest.py
messages: 116482
nosy: alexandre.vassalotti, amaury.forgeotdarc, belopolsky, collinwinter, 
eli.bendersky, ezio.melotti, flox, georg.brandl, jyasskin, pitrou, rhettinger, 
teresap989, terry.reedy
priority: normal
severity: normal
status: open
title: Inconsistencies in tracing list comprehensions
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file18895/tracetest.py

___
Python tracker 

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



[issue1633863] AIX: configure ignores $CC

2010-09-15 Thread R. David Murray

R. David Murray  added the comment:

Sébastien, you could email Martin (tracker id loewis) about adding your 
buildbot to our unstable fleet (or even to stable if it is stable; that is, the 
tests normally pass and don't randomly fail).  As long as you are around to 
help fix bugs it would be great to have an aix buildbot in our buildbot fleet.

(NB: see also http://wiki.python.org/moin/BuildBot, which unfortunately is a 
bit out of date...)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue9865] OrderedDict doesn't implement __sizeof__

2010-09-15 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

I wonder if type metaclass can be taught to handle this in general for 
subclasses implemented in python.

--
nosy: +belopolsky

___
Python tracker 

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



[issue9865] OrderedDict doesn't implement __sizeof__

2010-09-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

How do you want to "handle this in general"?

--

___
Python tracker 

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



[issue9866] Inconsistencies in tracing list comprehensions

2010-09-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

As I said in #9315, I think this kind of thing (bytecode traces) is an 
implementation detail; the changes in results shouldn't be regarded as breaking 
compatibility.
The only problem I could see would be if a whole line of code would be 
"forgotten".

--

___
Python tracker 

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



[issue9865] OrderedDict doesn't implement __sizeof__

2010-09-15 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

> How do you want to "handle this in general"?

Possibly by adding up __sizeof__'s of base and __dict__ in a generated 
function?  With a special handling of slots ...

May prove to be too complicated to be worth the effort.

--

___
Python tracker 

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



[issue9865] OrderedDict doesn't implement __sizeof__

2010-09-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> > How do you want to "handle this in general"?
> 
> Possibly by adding up __sizeof__'s of base and __dict__ in a generated
> function?  With a special handling of slots ...

I agree that in the general case this would be better, but for
OrderedDict it would still fail to give the right value (OrderedDict
also needs to take into account its internal node objects).

--

___
Python tracker 

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



[issue8077] urlparse

2010-09-15 Thread Nick Coghlan

Changes by Nick Coghlan :


--
title: cgi handling of POSTed files is broken -> urlparse

___
Python tracker 

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



[issue9863] threading, signals, atexit: different execution with different versions

2010-09-15 Thread Ned Deily

Ned Deily  added the comment:

I can verify that the test case terminates with 2.6.2 and 2.5.1 but does not 
for 2.6.6, 2.7, and 3.2.

This is indeed almost certainly due to Issue1722344. r75749 moved 
wait_for_thread_shutdown into Py_Finalize just before the atexit functions are 
called.  The previous behavior was considered a bug (see discussion at Msg66054 
so, by that standard, the test program here is incorrect and the fact that it 
worked prior to 2.6.2 was an accident.   The test can be fixed trivially of 
course by setting terminate in close_handler instead of the atexit handler.

--
nosy: +ned.deily

___
Python tracker 

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



[issue9860] Building python outside of source directory fails

2010-09-15 Thread Roumen Petrov

Roumen Petrov  added the comment:

Please could you remove object files from source tree then try again.

This is invalid issue.

--
nosy: +rpetrov

___
Python tracker 

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



[issue9866] Inconsistencies in tracing list comprehensions

2010-09-15 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Wed, Sep 15, 2010 at 5:33 PM, Antoine Pitrou  wrote:
..
> As I said in #9315, I think this kind of thing (bytecode traces) is an 
> implementation detail; the changes
> in results shouldn't be regarded as breaking compatibility.

In r74132, an attempt was made to rationalize and document line
tracing.  While it is an implementation detail, I don't think people
expect it to be platform dependent in CPython implementation.  "With
computed gotos" was supposed to be a pure optimization.  I find it
very surprising that it changes tracing behavior.

> The only problem I could see would be if a whole line of code would be 
> "forgotten".

This is exactly what my example demonstrates.

--

___
Python tracker 

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



[issue9865] OrderedDict doesn't implement __sizeof__

2010-09-15 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I have a hard time caring about this.  The main value of sys.getsizeof()
is to enable developers to determine the internal sizes of basic objects on a 
given build.  IIRC, there was no intention for this to become a requirement for 
pure python classes.

--
assignee:  -> rhettinger

___
Python tracker 

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



[issue9860] Building python outside of source directory fails

2010-09-15 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

On Wed, Sep 15, 2010 at 5:45 PM, Roumen Petrov  wrote:
..
> Please could you remove object files from source tree then try again.
>
It looks like you missed my penultimate comment.

> This is invalid issue.

At the very least, Building Python [1] section can be expanded to
cover building outside of the source tree.  Some developers are not
even aware that this is supported.

[1] http://docs.python.org/using/unix.html#building-python

--

___
Python tracker 

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



[issue6884] Impossible to include file in sdist that starts with 'build' on Win32

2010-09-15 Thread Éric Araujo

Éric Araujo  added the comment:

My feeling was that there was a logic bug in filelist (something explicitly 
added should not be filtered out by a default exclude pattern), so I’m glad to 
learn it’s just a regex bug.  I’ll add a test for the add/filter logic just in 
case.  Thanks a lot for the diagnosis and patch, I will probably commit it on 
Monday.

--

___
Python tracker 

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



[issue6884] Impossible to include file in sdist that starts with 'build' on Win32

2010-09-15 Thread Éric Araujo

Changes by Éric Araujo :


--
keywords: +patch -needs review
resolution:  -> accepted
stage: needs patch -> patch review
status: open -> pending

___
Python tracker 

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



[issue9863] threading, signals, atexit: different execution with different versions

2010-09-15 Thread Ned Deily

Ned Deily  added the comment:

A better fix for the program is to mark the test_loop thread as a daemon 
thread.  As the threading module documentation says, by default threads started 
from the main thread are non-daemon threads and the "entire Python program 
exits when no alive non-daemon threads are left."  The test case terminates 
properly by adding a thread.daemon = True after the threading.Thread call in 
run().

--

___
Python tracker 

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



[issue9863] threading, signals, atexit: different execution with different versions

2010-09-15 Thread Corey Bertram

Corey Bertram  added the comment:

let me preface this: I'm no expert on how this should be done ect...

The goal here was to specifically not set daemon on the test_loop thread. In an 
actual app test_loop would perhaps need to shutdown cleanly (save state or what 
have you). That said, your previous suggestion of moving the setting of 
terminate to the close handler (or maybe just call shutdown) works, but defeats 
the whole purpose of using atexit at all.

My understanding is that the main thread has ended execution due to the signal. 
If the signal handler called shutdown, when the test_loop thread exits, all of 
the atexit registered functions would execute (in this example it would mean 
calling the shutdown function twice). It just seems ugly now no matter what.

--

___
Python tracker 

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



[issue9863] threading, signals, atexit: different execution with different versions

2010-09-15 Thread Corey Bertram

Corey Bertram  added the comment:

On second thought, i'll just move forward with this new expected behavior. I 
understand the design decision and why it was made here in regards to waiting 
for threads to shutdown before atexit kicks in. My intended use for atexit just 
no longer works in this particular case.

--

___
Python tracker 

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



[issue9090] Error code 10035 calling socket.recv() on a socket with a timeout (WSAEWOULDBLOCK - A non-blocking socket operation could not be completed immediately)

2010-09-15 Thread Ben Smith

Ben Smith  added the comment:

I also see this issue on occasion on windows XP SP 3, using python 2.6.5 to 
fetch large files via http.

The error is infrequent, but it is happening in my situation without a VM.

--
nosy: +Ben.Smith

___
Python tracker 

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



[issue9090] Error code 10035 calling socket.recv() on a socket with a timeout (WSAEWOULDBLOCK - A non-blocking socket operation could not be completed immediately)

2010-09-15 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +exarkun, giampaolo.rodola
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.6

___
Python tracker 

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



[issue9090] Error code 10035 calling socket.recv() on a socket with a timeout (WSAEWOULDBLOCK - A non-blocking socket operation could not be completed immediately)

2010-09-15 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> It appears that there is a known issue with Windows sockets where this 
> type of problem may occur with non-blocking sockets. It is described in 
> the msdn documentation for WSAAsyncSelect()
> (http://msdn.microsoft.com/en-us/library/ms741540%28VS.85%29.aspx).

That documentation doesn't seem to describe the same kind of situation; it is 
about delayed notification through Windows messages (if you read the sequence 
they given in example, it's quite logical why it can fail).

Have you tried instrumenting sock_recv_guts() and dumping the actual return 
values and errnos (from both internal_select() and recv())?

--
nosy: +pitrou

___
Python tracker 

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



[issue9315] The trace module lacks unit tests

2010-09-15 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I agree with finishing this and opening a separate issue with respect to list 
comp behavior. The latter seems peripheral to the purpose of this issue.

--

___
Python tracker 

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



[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Daniel Stutzbach

Daniel Stutzbach  added the comment:

> Hmm, none the less other code expects it.

Does that imply that there's some code that will break on FileIO objects that 
are created using a file descriptor instead of a filename?  If so, where?

--

___
Python tracker 

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



[issue9865] OrderedDict doesn't implement __sizeof__

2010-09-15 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
keywords: +patch
stage:  -> patch review
type: behavior -> feature request
Added file: http://bugs.python.org/file18896/od_size.diff

___
Python tracker 

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



[issue9858] Python and C implementations of io are out of sync

2010-09-15 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2010/9/15 Daniel Stutzbach :
>
> Daniel Stutzbach  added the comment:
>
>> Hmm, none the less other code expects it.
>
> Does that imply that there's some code that will break on FileIO objects that 
> are created using a file descriptor instead of a filename?  If so, where?

No, just that all code that access name expects an AttributeError,
indicating that when there is no "name" an error should result.

--

___
Python tracker 

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



[issue9863] threading, signals, atexit: different execution with different versions

2010-09-15 Thread R. David Murray

R. David Murray  added the comment:

I'm closing this as invalid, but I note that this kind of behavior change is 
not something we would normally have done in a point release if we had realized 
the consequences.

--
resolution:  -> invalid
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue9867] Interrupted system calls are not retried on OS X

2010-09-15 Thread Armin Ronacher

New submission from Armin Ronacher :

Currently Python does not check fread and other IO calls for EINTR.  This 
usually is not an issue, but on OS X a continued program will be sent an 
SIGCONT signal which causes fread to be interrupted.

Testcase:

mitsuh...@nausicaa:~$ python2.7
Python 2.7 (r27:82508, Jul  3 2010, 21:12:11) 
[GCC 4.0.1 (Apple Inc. build 5493)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from signal import SIGCONT, signal
>>> def show_signal(*args):
...  print 'Got SIGCONT'
...  
>>> signal(SIGCONT, show_signal)
0
>>> import sys
>>> sys.stdin.read()
^Z
[1]+  Stopped python2.7
mitsuh...@nausicaa:~$ fg
python2.7
Got SIGCONT
Traceback (most recent call last):
  File "", line 1, in 
IOError: [Errno 4] Interrupted system call
>>> 

Expected behavior: on fg it should continue to read.  The solution would be to 
loop all calls to fread and friends until errno is no longer EINTR.  Now the 
question is how to best do that.  I can't think of a portable way to define a 
macro that continues to run an expression until errno is EINTR, maybe someone 
else has an idea.

Otherwise it would be possible to just put the loops by hand around each 
fread/fgetc etc. call, but that would make the code quite a bit more ugly.

Technically I suppose the problem applies to all platforms, on OS X it's just 
easier to trigger.

--
messages: 116504
nosy: aronacher
priority: normal
severity: normal
status: open
title: Interrupted system calls are not retried on OS X
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7, Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

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



[issue8077] cgi handling of POSTed files is broken

2010-09-15 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +r.david.murray
title: urlparse -> cgi handling of POSTed files is broken

___
Python tracker 

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



[issue9867] Interrupted system calls are not retried

2010-09-15 Thread Ned Deily

Ned Deily  added the comment:

The test fails exactly the same way using a python 2.6.6 on a current Debian 
(testing) Linux 2.6.32 so I think it better to remove the OS X from the title.  
Also the versions field refers to where a potential fix might be applied; that 
rules out 2.5 and 2.6 since it is not a security problem.

I was also curious if calling signal.siginterrupt for SIGCONT had any effect on 
this.  Neither False nor True on either OS X or linux seemed to change the 
behavior.

--
nosy: +ned.deily
title: Interrupted system calls are not retried on OS X -> Interrupted system 
calls are not retried
versions:  -Python 2.5, Python 2.6, Python 3.3

___
Python tracker 

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



[issue9868] test_locale leaves locale changed

2010-09-15 Thread Hirokazu Yamamoto

New submission from Hirokazu Yamamoto :

I noticed test_locale leaves locale changed.

# test_boo is simple test just to print windows error.

E:\python-dev\py3k\Lib\test>py3k -m test.regrtest test_locale test_boo
[1/2] test_locale
[2/2] test_boo
test test_boo failed -- Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\test\test_boo.py", line 11, in test
os.rmdir(TMPDIR)
WindowsError: [Error 2] ?w’e?3?e??...@?c???a?c?a?c?e?u?1?n?b: 'e:\\python-dev\\
py3k\\lib\\test\\__boo__'
Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\test\regrtest.py", line 941, in runtest_inner
indirect_test()
  File "e:\python-dev\py3k\lib\test\test_boo.py", line 14, in test_main
support.run_unittest(TestCase)
  File "e:\python-dev\py3k\lib\test\support.py", line 1128, in run_unittest
_run_suite(suite)
  File "e:\python-dev\py3k\lib\test\support.py", line , in _run_suite
raise TestFailed(err)
test.support.TestFailed: Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\test\test_boo.py", line 11, in test
os.rmdir(TMPDIR)
WindowsError: [Error 2] ?w’e?3?e??...@?c???a?c?a?c?e?u?1?n?b: 'e:\\python-dev\\
py3k\\lib\\test\\__boo__'
test.support.TestFailed: Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\test\test_boo.py", line 11, in test
os.rmdir(TMPDIR)
WindowsError: [Error 2] ?w’e?3?e??...@?c???a?c?a?c?e?u?1?n?b: 'e:\\python-dev\\
py3k\\lib\\test\\__boo__'

During handling of the above exception, another exception occurred:

test test_boo failed -- Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\test\test_boo.py", line 11, in test
os.rmdir(TMPDIR)
WindowsError: [Error 2] ?w’e?3?e??...@?c???a?c?a?c?e?u?1?n?b: 'e:\\python-dev\\
py3k\\lib\\test\\__boo__'
test.support.TestFailed: Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\test\test_boo.py", line 11, in test
os.rmdir(TMPDIR)
WindowsError: [Error 2] ?w’e?3?e??...@?c???a?c?a?c?e?u?1?n?b: 'e:\\python-dev\\
py3k\\lib\\test\\__boo__'

During handling of the above exception, another exception occurred:

Exception IOError: 'raw write() returned invalid length 253 (should have been be
tween 0 and 252)' in <_io.TextIOWrapper name='' encoding='cp932'> ignore
d
test.support.TestFailed: Traceback (most recent call last):
  File "e:\python-dev\py3k\lib\test\test_boo.py", line 11, in test
os.rmdir(TMPDIR)
WindowsError: [Error 2] ?w’e?3?e??...@?c???a?c?a?c?e?u?1?n?b: 'e:\\python-dev\\
py3k\\lib\\test\\__boo__'

During handling of the above exception, another exception occurred:

Exception IOError: 'raw write() returned invalid length 253 (should have been be
tween 0 and 252)' in <_io.TextIOWrapper name='' encoding='cp932'> ignore
d
[79459 refs]

/
// test_boo.py

from test import support
import unittest
import os

TMPDIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), 
"__notexist__")

class TestCase(unittest.TestCase):
def test(self):
os.rmdir(TMPDIR)

def test_main():
support.run_unittest(TestCase)

if __name__ == '__main__':
test_main()

--
components: Tests
messages: 116506
nosy: ocean-city
priority: normal
severity: normal
status: open
title: test_locale leaves locale changed
versions: Python 3.1, Python 3.2

___
Python tracker 

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



[issue9868] test_locale leaves locale changed

2010-09-15 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

This happens because in Lib/test/test_locale.py,
TestEnUSCollation#setUp raises exception after
BaseLocalizedTest.setUp(self) changed locale.
tearDown never be called when setUp failedsetUp failed.

It's easy to fix this as is, but I think more general
solution would be better.

How about the mechanism like this? It calls setUp() and
tearDown() in according to MRO, if setUp() fails somewhere
in the chain, calls tearDown() for the class whose setUp()
is successfully called. (Be care, you shouldn't call
parent's setUp() or tearDown() directly)


// mockup

import unittest

class TestCase2(unittest.TestCase):
def setUp(self):
klasses = []
try:
for klass in reversed(self.__class__.__mro__):
func = getattr(klass, "setUp2", None)
if func is not None:
func(self)
klasses.append(klass)
except:
for klass in reversed(klasses):
func = getattr(klass, "tearDown2", None)
if func is not None:
func(self)
raise
def tearDown(self):
for klass in self.__class__.__mro__:
func = getattr(klass, "tearDown2", None)
if func is not None:
func(self)

class A(TestCase2):
def setUp2(self):
print("A#setUp2")
def tearDown2(self):
print("A#tearDown2")

class B(A):
def setUp2(self):
print("B#setUp2")
raise RuntimeError("B#setUp2 failed")
def tearDown2(self):
print("B#tearDown2")
def test(self):
pass

if __name__ == '__main__':
unittest.main()


// result

A#setUp2
B#setUp2
A#tearDown2
(snip)

--

___
Python tracker 

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



[issue9815] test_tarfile sometimes ends with error "Cannot remove dir"

2010-09-15 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Here is the simple test case to demonstrate this issue.

--
Added file: http://bugs.python.org/file18897/test_traceback_freed.py

___
Python tracker 

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



[issue9810] bzip2 build sometimes fails (VS8.0)

2010-09-15 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Thank you for the reply. I agree with you. I'll try to
create latter option.

--

___
Python tracker 

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



[issue9810] bzip2 build sometimes fails (VS8.0)

2010-09-15 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

- create latter option
+ create the patch by latter option

--

___
Python tracker 

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



[issue9810] bzip2 build sometimes fails (VS8.0)

2010-09-15 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Probably this patch works.

P.S.
These lines in PCBuild/vs9to8.py seem to be not needed. I could
build python even without it, (I only tried py3k)

  # Bah. VS8.0 does not expand macros in file names.
  # Replace them here.
  lines = lines.replace('$(sqlite3Dir)', '..\\..\\..\\sqlite-3.6.21')

I'm not sure, maybe VS8 SP1's bug? I tried on this.

  Microsoft Visual Studio 2005
  Version 8.0.50727.42  (RTM.050727-4200)

--
keywords: +patch
Added file: http://bugs.python.org/file18898/py3k_bz2_vcproj.patch

___
Python tracker 

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



[issue8746] os.chflags() and os.lchflags() are not built when they should be be

2010-09-15 Thread Garrett Cooper

Garrett Cooper  added the comment:

*NOUNLINK was not implemented by OSX, so there's actually a bug with the 
compile tests if you take that into consideration. And again, only FreeBSD 
defines *NOUNLINK. The other BSDs, not so much.

As far as the reason why I implemented the flags, the documentation that I was 
looking at didn't implement those flags. I looked at the latest documentation 
and it appears to be correct though. I will implement tests for *UNLINK and 
*HIDDEN (FWIW the tests I wrote are ok for cross-compilation because they just 
test for the existence of the values -- they don't test to ensure that the 
functionality is correct, like some of the logic in configure was recently 
`fixed' to do).

--

___
Python tracker 

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