[issue1503] test_xmlrpc is still flakey

2008-03-27 Thread Neal Norwitz

Neal Norwitz <[EMAIL PROTECTED]> added the comment:

Ugh.  The manpage for accept on Ubuntu 6.10 says:

"""
On  Linux,  the  new  socket returned by accept() does not inherit file
status flags such as O_NONBLOCK and O_ASYNC from the listening  socket.
This  behaviour  differs from the canonical BSD sockets implementation.
Portable programs should not rely on inheritance or non-inheritance  of
file  status  flags and always explicitly set all required flags on the
socket returned from accept().
"""

http://msdn2.microsoft.com/en-us/library/aa450277.aspx says that Windows
(CE, but I assume all variants) are like BSD in that they inherit
attributes.

"""The newly created socket is the socket that will handle the actual
connection and has the same properties as socket s, including the
asynchronous events registered with the WSAEventSelect function."""

I assume that means blocking behavior.

I checked in r61993 which should fix the immediate problem with
test_xmlrpc.  I wonder if we should change socket to do the same thing
for all platforms.

--
nosy: +nnorwitz

__
Tracker <[EMAIL PROTECTED]>

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



[issue2497] stdbool support

2008-03-27 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

> Some compilers define false and true as macros.

Which compilers specifically? It sounds like a violation of the C
standard to do so, without stdbool.h being included.

> Using stdbool.h when it is available will ensure bool is defined as a 
> type following the correct definition, which may or may not be an enum 
> depending on the compiler.

But would that help in any way with respect to above compilers?
If they don't follow the C standard, why should they provide stdbool.h?

> Even when using gcc, stdbool.h is here to define bool in C language, so 
> why not use it ?

Because we cannot *rely* on stdbool.h being present. Therefore,
inclusion of stdbool.h must be conditional, with a fallback definition
if stdbool.h is absent, and it thus complicates the source code of
Python, with no gain whatsoever.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2459] speedup loops with better bytecode

2008-03-27 Thread Jeffrey Yasskin

Changes by Jeffrey Yasskin <[EMAIL PROTECTED]>:


--
nosy: +jyasskin

__
Tracker <[EMAIL PROTECTED]>

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



[issue2496] test_no_refcycle_through_target sometimes fails in test_threading

2008-03-27 Thread Jeffrey Yasskin

Jeffrey Yasskin <[EMAIL PROTECTED]> added the comment:

Fixed in r61984. I believe the exception info was actually keeping the
object alive. The thread itself didn't have any references to it, but
the traceback did.

--
resolution:  -> fixed
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue2499] Fold unary + and not on constants

2008-03-27 Thread Alexander Belopolsky

New submission from Alexander Belopolsky <[EMAIL PROTECTED]>:

Before:

>>> dis(lambda:+2)
  1   0 LOAD_CONST   0 (2)
  3 UNARY_POSITIVE  
  4 RETURN_VALUE
>>> dis(lambda:not 2)
  1   0 LOAD_CONST   0 (2)
  3 UNARY_NOT   
  4 RETURN_VALUE

After:

>>> dis(lambda:+2)
  1   0 LOAD_CONST   1 (2)
  3 RETURN_VALUE
>>> dis(lambda:not 2)
  1   0 LOAD_CONST   1 (False)
  3 RETURN_VALUE

--
components: Interpreter Core
files: fold-unary.diff
keywords: patch
messages: 64613
nosy: belopolsky
severity: normal
status: open
title: Fold unary + and not on constants
type: resource usage
versions: Python 2.6
Added file: http://bugs.python.org/file9880/fold-unary.diff

__
Tracker <[EMAIL PROTECTED]>

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



[issue2496] test_no_refcycle_through_target sometimes fails in test_threading

2008-03-27 Thread Jeffrey Yasskin

Jeffrey Yasskin <[EMAIL PROTECTED]> added the comment:

I think I've confirmed your diagnosis. If I add a _sleep(.01) to
Thread.__bootstrap_inner() just after the call to self.__stop(), the
test fails reliably. Very good catch! Given that, I think just adding a
short sleep to the test before counting references will fix it nearly
every time, but I'd like to kill the race dead if we can.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2453] fix_except needs to allow for empty excepts

2008-03-27 Thread Collin Winter

Collin Winter <[EMAIL PROTECTED]> added the comment:

Fixed in r61983.

--
resolution:  -> fixed
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue2480] pickling of large recursive structures fails

2008-03-27 Thread Jesús Cea Avión

Changes by Jesús Cea Avión <[EMAIL PROTECTED]>:


--
nosy: +jcea

__
Tracker <[EMAIL PROTECTED]>

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



[issue2497] stdbool support

2008-03-27 Thread Rolland Dudemaine

Rolland Dudemaine <[EMAIL PROTECTED]> added the comment:

Some compilers define false and true as macros.
When doing this, the definition in asdl.h (included from asdl.c) which 
is originally :
typedef enum {false, true} bool;
therefore becomes :
typedef enum {0, 1} bool;
which is non-sensical.
Using stdbool.h when it is available will ensure bool is defined as a 
type following the correct definition, which may or may not be an enum 
depending on the compiler.
Even when using gcc, stdbool.h is here to define bool in C language, so 
why not use it ?

--Rolland

Martin v. Löwis wrote:
> Martin v. Löwis <[EMAIL PROTECTED]> added the comment:
>
> Why does it improve portability to use stdbool.h when it exists?
>
> What is the potential issue with asdl.c that gets fixed with this patch?
>
> --
> nosy: +loewis
>
> __
> Tracker <[EMAIL PROTECTED]>
> 
> __
>

__
Tracker <[EMAIL PROTECTED]>

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



[issue2495] tokenize doesn't handle __future__.unicode_literals correctly

2008-03-27 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

Actually, the problem is that untokenize does not put spaces between two
consecutive string literals:

'' '' => 

Corrected with r61979.
Will backport

--
nosy: +amaury.forgeotdarc
resolution:  -> fixed
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue2496] test_no_refcycle_through_target sometimes fails in test_threading

2008-03-27 Thread Jeffrey Yasskin

Jeffrey Yasskin <[EMAIL PROTECTED]> added the comment:

I'll look at this tonight.

--
assignee:  -> jyasskin
nosy: +jyasskin

__
Tracker <[EMAIL PROTECTED]>

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



[issue2498] bdb modernized

2008-03-27 Thread Benjamin Peterson

New submission from Benjamin Peterson <[EMAIL PROTECTED]>:

bdb.py has several places like this:
try:
try: pass
except BdbQuit: pass
finally: pass
These can be modernized to the > 2.5 syntax.

--
assignee: georg.brandl
components: Library (Lib)
files: bdb_modern.patch
keywords: patch
messages: 64607
nosy: benjamin.peterson, georg.brandl
severity: normal
status: open
title: bdb modernized
type: feature request
versions: Python 2.6
Added file: http://bugs.python.org/file9879/bdb_modern.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-27 Thread Jean-Philippe Laverdure

Jean-Philippe Laverdure <[EMAIL PROTECTED]> added the comment:

Hi Skip,

You're right, it does seem that using f.read(1024) to feed the sniffer
works OK in my case and allows me to instantiate the DictReader
correctly...  Why that is I'm not sure though...

I was submitting the first line as I thought is was the right sample to
provide the sniffer for it to sniff the correct dialect regardless of
the file format and file content.

And yes, 'except csv.Error' is certainly a better way to trap my desired
exception... I guess I'm a bit of a n00b using Python.

Thanks for the help. 
Python really has a great community !

__
Tracker <[EMAIL PROTECTED]>

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



[issue2459] speedup loops with better bytecode

2008-03-27 Thread Lauro Moura

Changes by Lauro Moura <[EMAIL PROTECTED]>:


--
nosy: +lauromoura

__
Tracker <[EMAIL PROTECTED]>

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



[issue2497] stdbool support

2008-03-27 Thread Martin v. Löwis

Martin v. Löwis <[EMAIL PROTECTED]> added the comment:

Why does it improve portability to use stdbool.h when it exists?

What is the potential issue with asdl.c that gets fixed with this patch?

--
nosy: +loewis

__
Tracker <[EMAIL PROTECTED]>

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



[issue2451] No way to disable socket timeouts in httplib, etc.

2008-03-27 Thread John J Lee

John J Lee <[EMAIL PROTECTED]> added the comment:

Great.  I'll try to submit a patch this weekend.

__
Tracker <[EMAIL PROTECTED]>

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



[issue433030] SRE: (?>...) is not supported

2008-03-27 Thread Jeffrey C. Jacobs

Changes by Jeffrey C. Jacobs <[EMAIL PROTECTED]>:


--
nosy: +timehorse


Tracker <[EMAIL PROTECTED]>


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



[issue2459] speedup loops with better bytecode

2008-03-27 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Armin, your patch gives a speed-up for "for" loops and comprehensions,
although a bit less. Also, it doesn't speed up "while" loops and "if"
statements at all. For some reasons it also appears to make pystone a
bit slower. Here are some micro-benchmarks:

./python -m timeit "for x in xrange(1): pass"
Before: 1000 loops, best of 3: 758 usec per loop
After: 1000 loops, best of 3: 483 usec per loop

./python -m timeit "x=100" "while x: x -= 1"
Before: 1 loops, best of 3: 21.8 usec per loop
After: 1 loops, best of 3: 21.6 usec per loop

./python -m timeit -s "l = range(100)" "[x for x in l]"
Before: 10 loops, best of 3: 14.9 usec per loop
After: 10 loops, best of 3: 13.3 usec per loop

./python -m timeit -s "l = range(100)" "[x for x in l if x]"
Before: 1 loops, best of 3: 23.9 usec per loop
After: 1 loops, best of 3: 22.3 usec per loop

./python -m timeit -s "l = range(100)" "[x for x in l if not x]"
Before: 10 loops, best of 3: 15.8 usec per loop
After: 10 loops, best of 3: 13.9 usec per loop

./python Tools/pybench/pybench.py -t IfThenElse
Before: 164ms per round
After: 166ms per round

__
Tracker <[EMAIL PROTECTED]>

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



[issue2496] test_no_refcycle_through_target sometimes fails in test_threading

2008-03-27 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

I'm attaching a patch which tries to make the test a bit less flaky
(well, it still is, since I introduce a time.sleep() :-)).

Added file: http://bugs.python.org/file9878/test_threading2.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2406] Improvement suggestions for the gzip module documentation

2008-03-27 Thread Guilherme Polo

Guilherme Polo <[EMAIL PROTECTED]> added the comment:

If I could I would commit it, but you have my support on this one
nevertheless ;)

__
Tracker <[EMAIL PROTECTED]>

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



[issue2496] test_no_refcycle_through_target sometimes fails in test_threading

2008-03-27 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Hmm, I think I know what happens. t_bootstrap() in threadmodule.c calls
the self.__bootstrap() method in the Thread object, and it is this
method which sets the __stopped flag at its end, which in turns wakes up
the join() method.

The problem is that at this point, t_bootstrap() still (rightly) holds a
reference to the Thread object, since it has a reference to its
__bootstrap() method which is still running. Depending on how the
operating system switches threads, this reference may or may not be
released when the join() method returns.

So I think it's the test that is flaky. Instead of calling the join()
method, it should wait for the OS-level thread to finish. Or it should
find another way of testing for the reference cycle.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2459] speedup loops with better bytecode

2008-03-27 Thread Armin Rigo

Armin Rigo <[EMAIL PROTECTED]> added the comment:

Can you see if this simpler patch also gives speed-ups?
(predict_loop.diff)

--
nosy: +arigo
Added file: http://bugs.python.org/file9877/predict_loop.diff

__
Tracker <[EMAIL PROTECTED]>

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



[issue2406] Improvement suggestions for the gzip module documentation

2008-03-27 Thread M.-A. DARCHE

M.-A. DARCHE <[EMAIL PROTECTED]> added the comment:

Here is the diff of the suggested modifications, which include Guilherme
remarks.

This is the kind of doc I would have like to read when I needed it.

Regards.

--
keywords: +patch
Added file: http://bugs.python.org/file9876/gzip.rst.diff

__
Tracker <[EMAIL PROTECTED]>

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



[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-27 Thread Skip Montanaro

Skip Montanaro <[EMAIL PROTECTED]> added the comment:

Jean-Philippe> The fact is this code is in use in an application where
Jean-Philippe> users can submit a .csv file produced by Excel for
Jean-Philippe> treatment.  The file must contain a "Sequence" column
Jean-Philippe> since that is what the treatment is run on. Now I had to
Jean-Philippe> make the following changes to my code to account for the
Jean-Philippe> fact that some users submit a single column file (since
Jean-Philippe> only the "Sequence" column is required for treatment):

Jean-Philippe> f = open(sys.argv[-1], 'r')
Jean-Philippe> try:
Jean-Philippe> dialect = csv.Sniffer().sniff(f.readline(), [',', '\t'])
Jean-Philippe> f.seek(0)
Jean-Philippe> reader = csv.DictReader(f, dialect=dialect)
Jean-Philippe> except:
Jean-Philippe> print '>>>caught csv sniff() exception'
Jean-Philippe> f.seek(0)
Jean-Philippe> reader = csv.DictReader(f)
Jean-Philippe> for line in reader:
Jean-Philippe> Do what I need to do

What exceptions are you catching?  Why are you only giving it a single line
of input as a sample?  What happens if you instead use f.read(1024) as the
sample?  When there is only a single column in the file and you give it a
delimiter set which doesn't include any characters in the file it (I think
correctly) raises an exception to tell you that it couldn't determine the
delimiter:

>>> import csv
>>> f = open("listB2Mforblast.csv")
>>> dialect = csv.Sniffer().sniff(f.read(1024))
>>> dialect.delimiter
'"'
>>> f.seek(0)
>>> dialect = csv.Sniffer().sniff(f.read(1024), ",\t :;")
Traceback (most recent call last):
  File "", line 1, in 
  File "/Users/skip/local/lib/python2.6/csv.py", line 161, in sniff
raise Error, "Could not determine delimiter"
_csv.Error: Could not determine delimiter

In that case, use csv.excel as the dialect.  It doesn't matter what you use
as the delimiter if it doesn't occur in the file, and if it can't figure out
the delimiter it's also not going to guess the quotechar.

>>> try:
... dialect = csv.Sniffer().sniff(f.read(1024), ",\t :;")
... except csv.Error:
... dialect = csv.excel
... 

I personally don't much like the sniffer.  It doesn't use any knowledge of
the structure of a CSV file to guess the delimiter and quotechar (and those
are the only two parameters it does guess).  I would prefer if it just went
away, but folks use it so it's likely to remain in its current form for the
forseeable future.

Skip

__
Tracker <[EMAIL PROTECTED]>

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



[issue2496] test_no_refcycle_through_target sometimes fails in test_threading

2008-03-27 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

Hmm, even with a Py_DEBUG build I can't reproduce the bug.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2078] CSV Sniffer does not function properly on single column .csv files

2008-03-27 Thread Jean-Philippe Laverdure

Jean-Philippe Laverdure <[EMAIL PROTECTED]> added the comment:

Hello and sorry for the late reply.

Wolfgang: sorry about my misuse of the csv.DictReader constructor, that 
was a mistake on my part. However, it still is not functionning as I
think it should/could.  Look at this:

Using this content:
Sequence
AAGINRDSL
AAIANHQVL

and this piece of code:
f = open(sys.argv[-1], 'r')
dialect = csv.Sniffer().sniff(f.readline())
f.seek(0)
reader = csv.DictReader(f, dialect=dialect)
for line in reader:
print line

I get this result:
{'Sequen': 'AAGINRDSL', 'e': None}
{'Sequen': 'AAIANHQVL', 'e': None}

When I really should be getting this:
{'Sequence': 'AAGINRDSL'}
{'Sequence': 'AAIANHQVL'}

The fact is this code is in use in an application where users can submit
a .csv file produced by Excel for treatment.  The file must contain a
"Sequence" column since that is what the treatment is run on. Now I had
to make the following changes to my code to account for the fact that
some users submit a single column file (since only the "Sequence" column
is required for treatment):

f = open(sys.argv[-1], 'r')
try:
dialect = csv.Sniffer().sniff(f.readline(), [',', '\t'])
f.seek(0)
reader = csv.DictReader(f, dialect=dialect)
except:
print '>>>caught csv sniff() exception'
f.seek(0)
reader = csv.DictReader(f)
for line in reader:
Do what I need to do

Which really feels like a patched use of a buggy implementation of the
Sniffer class

I understand the issues raised by Skip in regards to figuring out a
delimiter at all costs...  But really, the Sniffer class should work
apropriately when a single column .csv file is submitted

__
Tracker <[EMAIL PROTECTED]>

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



[issue2497] stdbool support

2008-03-27 Thread Rolland Dudemaine

Changes by Rolland Dudemaine <[EMAIL PROTECTED]>:


--
type:  -> compile error

__
Tracker <[EMAIL PROTECTED]>

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



[issue2497] stdbool support

2008-03-27 Thread Rolland Dudemaine

New submission from Rolland Dudemaine <[EMAIL PROTECTED]>:

For better portability, it is good to support stdbool.h when it exists.
This prevents a potential issue when compiling asdl.c.
Patch attached.

--
components: Build
files: python_stdbool_20080327.diff
keywords: patch
messages: 64594
nosy: rolland
severity: normal
status: open
title: stdbool support
versions: Python 2.5, Python 2.6, Python 3.0
Added file: http://bugs.python.org/file9875/python_stdbool_20080327.diff

__
Tracker <[EMAIL PROTECTED]>

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



[issue1294959] Problems with /usr/lib64 builds.

2008-03-27 Thread Alexander Belopolsky

Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

Placing the entire library tree in /usr/lib64 is wasteful on dual 
32/64bit installation, but placing just the C modules there is contrary 
to python import logic and may cause problems to relative imports.

I have suggested what I believed was a workable solution: have 64-bit 
python search lib64-dynload subdirectories instead of lib-dynload.

See http://mail.python.org/pipermail/python-dev/2007-April/072653.html

Currently $(prefix)/pythonX.Y/lib-dynload is inserted in the sys.path, 
but I think it would be better to handle this inside the importer in a 
way similar to how the importer looks for both foo.so and foomodule.so 
when importing foo. This would allow submodules and user modules treated  
the same way.

_
Tracker <[EMAIL PROTECTED]>

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



[issue1294959] Problems with /usr/lib64 builds.

2008-03-27 Thread Alexander Belopolsky

Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

Can someone update the priority so that this is looked at before the 2.6 
release?

--
nosy: +belopolsky

_
Tracker <[EMAIL PROTECTED]>

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



[issue2375] PYTHON3PATH environment variable to supersede PYTHONPATH for multi-Python environments

2008-03-27 Thread Alexander Belopolsky

Alexander Belopolsky <[EMAIL PROTECTED]> added the comment:

I have never had a problem of different python versions coexisting on 
the same machine, but having 32-bit and 64-bit python coexist is much 
harder. Particularly when 32-bit python is compiled on the 64-bit OS 
(using -m32 flag).  There is a related issue1294959 highlighting this 
problem.

See also issue1536339, issue1553166, and issue858809.

Ideally, I would like to see a mechanism that would allow both standard 
library and user modules to share machine independent (*.py{,c,o}) files 
while having separate locations for 32-bit and 64-bit C modules.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2248] quit() method of SMTP instance (of smtplib) doesn't return it's result

2008-03-27 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

Added docs and committed as r61977.

--
nosy: +georg.brandl
resolution:  -> accepted
status: open -> closed

__
Tracker <[EMAIL PROTECTED]>

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



[issue812750] OSA support for properties broken

2008-03-27 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
priority: high -> low


Tracker <[EMAIL PROTECTED]>


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



[issue1261390] import dynamic library bug?

2008-03-27 Thread Georg Brandl

Changes by Georg Brandl <[EMAIL PROTECTED]>:


--
resolution:  -> out of date
status: open -> closed

_
Tracker <[EMAIL PROTECTED]>

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



[issue2375] PYTHON3PATH environment variable to supersede PYTHONPATH for multi-Python environments

2008-03-27 Thread Georg Brandl

Georg Brandl <[EMAIL PROTECTED]> added the comment:

I even run modules compiled for Python 2.2 successfully on 2.5...

--
nosy: +georg.brandl

__
Tracker <[EMAIL PROTECTED]>

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



[issue2443] uninitialized access to va_list

2008-03-27 Thread Rolland Dudemaine

Rolland Dudemaine <[EMAIL PROTECTED]> added the comment:

Actually, this thing is more complex to solve than I thought.
Specifically, as described in
http://www.opengroup.org/onlinepubs/007908775/xsh/stdarg.h.html stdarg
requires that variable argument functions have at least one fixed argument.
This is implied by the declaration of "void va_start(va_list ap, argN);".
As explained in the original ticket description, and also described
before in the above link, va_start() must be called before any call to
va_arg(), and this includes any access to the argument list using
__va_copy namely.

The problem is that at least objargs_mktuple(), line 2649 of
Objects/abstract.c does not have a first fixed argument.

__
Tracker <[EMAIL PROTECTED]>

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



[issue2406] Improvement suggestions for the gzip module documentation

2008-03-27 Thread M.-A. DARCHE

M.-A. DARCHE <[EMAIL PROTECTED]> added the comment:

Thanks Guilherme (I hope Guilherme is your first name) for your very
constructive answer. I'll do exactly as you  suggest.

Regards

__
Tracker <[EMAIL PROTECTED]>

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



[issue2496] test_no_refcycle_through_target sometimes fails in test_threading

2008-03-27 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

This is a tentative patch. I can't verify it fixes anything but at least
it shouldn't do any harm ;)
If it doesn't fix it I see two possible explanations:
- the buildbots are running some kind of debug build which keeps
references to local variables, preventing them to be deallocated
- the C thread implementation needs fixing on some platforms

--
keywords: +patch
Added file: http://bugs.python.org/file9874/test_threading.patch

__
Tracker <[EMAIL PROTECTED]>

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



[issue2451] No way to disable socket timeouts in httplib, etc.

2008-03-27 Thread Facundo Batista

Facundo Batista <[EMAIL PROTECTED]> added the comment:

Mmm it seems that not only overlooked this final agreement, but also
forgot it! Bloody brain, :(

I'll happily review any proposed patch for this. Alan, maybe you can be
persuaded to submit one? <.5 wink>

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

__
Tracker <[EMAIL PROTECTED]>

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



[issue2494] Can't round-trip datetimes<->timestamps prior to 1970 on Windows

2008-03-27 Thread Christian Heimes

Christian Heimes <[EMAIL PROTECTED]> added the comment:

It's most likely a platform limitation. Some platforms doen't support
negative time stamps.

--
nosy: +tiran

__
Tracker <[EMAIL PROTECTED]>

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



[issue2495] tokenize doesn't handle __future__.unicode_literals correctly

2008-03-27 Thread Christian Heimes

New submission from Christian Heimes <[EMAIL PROTECTED]>:

See r61976

Clear the blacklist and run the test with 

  ./python Lib/test/regrtest.py -uall test_tokenize

to reproduce the issue.

--
components: Library (Lib)
messages: 64582
nosy: tiran
priority: normal
severity: normal
status: open
title: tokenize doesn't handle __future__.unicode_literals correctly
versions: Python 2.6

__
Tracker <[EMAIL PROTECTED]>

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



[issue2496] test_no_refcycle_through_target sometimes fails in test_threading

2008-03-27 Thread Antoine Pitrou

New submission from Antoine Pitrou <[EMAIL PROTECTED]>:

This is a reminder for the failing test which is affecting some buildbots.
I can't reproduce it right now (under Linux), even by surrounding the
test code with a pair of gc.disable() / gc.enable().

--
components: Library (Lib)
messages: 64584
nosy: nnorwitz, pitrou
severity: normal
status: open
title: test_no_refcycle_through_target sometimes fails in test_threading
type: behavior
versions: Python 2.6

__
Tracker <[EMAIL PROTECTED]>

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



[issue1555570] email parser incorrectly breaks headers with a CRLF at 8192

2008-03-27 Thread Thomas Guettler

Thomas Guettler <[EMAIL PROTECTED]> added the comment:

I was hit by this bug in Django. The ticket URL:

http://code.djangoproject.com/ticket/6256

It would be nice if this could be fixed.

--
nosy: +guettli

_
Tracker <[EMAIL PROTECTED]>

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



[issue2406] Improvement suggestions for the gzip module documentation

2008-03-27 Thread Guilherme Polo

Guilherme Polo <[EMAIL PROTECTED]> added the comment:

Hello,

(some comments)

What about using gzip.open instead of GzipFile ? It is just a shorthand,
but I prefer it (just my opinion). Also, remove those semicolons.

At the second example you called close on the string object, I guess you
intended to do file_obj.close()

In the third example you used "file", please change that to "open". In
this sample example, you don't need to use shutil. I suggest changing it to:

import gzip
f_in = open('/home/joe/file.txt', 'rb')
f_out = gzip.open('/home/joe/file.txt.gz', 'wb');
f_out.writelines(f_in)
file_obj_out.close()
f_out.close()

Finally, consider doing these changes against Doc/library/gzip.rst and
sending the diff

--
nosy: +gpolo

__
Tracker <[EMAIL PROTECTED]>

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



[issue815646] thread unsafe file objects cause crash

2008-03-27 Thread Antoine Pitrou

Antoine Pitrou <[EMAIL PROTECTED]> added the comment:

A small addition to Christian's code snippet allows me to reproduce the
problem as well:

import thread

f=open("tmp1", "w")

def worker():
global f
while 1:
f.close()
f = open("tmp1", "w")
f.seek(0,0) 

thread.start_new_thread(worker, ())
thread.start_new_thread(worker, ())

while 1:
pass

--
nosy: +pitrou


Tracker <[EMAIL PROTECTED]>


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



[issue2494] Can't round-trip datetimes<->timestamps prior to 1970 on Windows

2008-03-27 Thread Mark Summerfield

New submission from Mark Summerfield <[EMAIL PROTECTED]>:

# If you run the code below on Py30a3 you get the output shown at the end
import calendar, datetime, time

pastdate = datetime.datetime(1969, 12, 31)
print(pastdate)
timestamp = calendar.timegm(pastdate.utctimetuple())
print(timestamp)
try:
pastdate_x = datetime.datetime.utcfromtimestamp(timestamp)
except ValueError as err:
print("FAIL", err)
try:
print(time.strftime("%Y-%m-%dT%H:%M:%S", time.gmtime(timestamp)))
except ValueError as err:
print("FAIL", err)

r"""
Python 30a3

Windows output:

1969-12-31 00:00:00
-86400
FAIL timestamp out of range for platform localtime()/gmtime() function
FAIL (22, 'Invalid argument')

Linux output:
1969-12-31 00:00:00
-86400
1969-12-31T00:00:00
"""
# What this appears to show is that you can't round-trip between
datetimes and timestamps on Windows for dates prior to 1970

--
components: Library (Lib)
messages: 64578
nosy: mark
severity: normal
status: open
title: Can't round-trip datetimes<->timestamps prior to 1970 on Windows
type: behavior
versions: Python 3.0

__
Tracker <[EMAIL PROTECTED]>

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



[issue2459] speedup loops with better bytecode

2008-03-27 Thread P. Henrique Silva

Changes by P. Henrique Silva <[EMAIL PROTECTED]>:


--
nosy: +phsilva

__
Tracker <[EMAIL PROTECTED]>

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