[issue6460] test failure in test_xmlrpc on Gentoo in trunk

2009-07-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

This is probably a race condition, where the server thread hasn't updated 
the stats yet when the client is testing them.  I'm so used to work with 
non-preemtive scheduling in stackless python that I sometimes forget how 
threads work :)
I submitted revision 73932 for the trunk, please test.

--

___
Python tracker 

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



[issue6358] os.popen exit code inconsistent

2009-07-11 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Added a few tests, and fixed in r73934 (py3k) and r73935 (3.1)
Thanks for the report!

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

___
Python tracker 

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



[issue6459] Lib/distutils\tests\test_build_ext.py fails on VC6

2009-07-11 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

Confirmed with vs2008. I wonder why the buildbots don't fail.

--
nosy: +amaury.forgeotdarc

___
Python tracker 

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



[issue6446] import_spam() in extending python can fail without setting the error.

2009-07-11 Thread Georg Brandl

Georg Brandl  added the comment:

Thanks, fixed in r73938.

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

___
Python tracker 

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



[issue6448] imp.find_module() -- be explicity that 'path' must be a list

2009-07-11 Thread Georg Brandl

Georg Brandl  added the comment:

I reworded the paragraph a bit in r73939.

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

___
Python tracker 

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



[issue6459] Lib/distutils\tests\test_build_ext.py fails on VC6

2009-07-11 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Thanks for the patch, I'll integrate asap.

Notice that I run the tests under windows but without a full range of VC
versions, so I count a lot on the buildbots to show me these kind of
failures.

--
priority:  -> normal
resolution:  -> accepted

___
Python tracker 

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



[issue6430] array.array falsely advertises support for 'w' in documentation

2009-07-11 Thread Georg Brandl

Georg Brandl  added the comment:

OK, fixed this in r73940, r73941, r73942.

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

___
Python tracker 

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



[issue6421] errors in docs re module initialization vs self arg to functions

2009-07-11 Thread Georg Brandl

Georg Brandl  added the comment:

Fixed both instances in r73943.

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

___
Python tracker 

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



[issue1921] Confusing Descrintro example

2009-07-11 Thread Georg Brandl

Changes by Georg Brandl :


--
assignee: georg.brandl -> gvanrossum
nosy: +gvanrossum

___
Python tracker 

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



[issue6459] Lib/distutils\tests\test_build_ext.py fails on VC6

2009-07-11 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Mmm, also notice that the current build_ext trunk uses "init"
 in the code, which means that the "PyInit" prefix was added on 
py3k but not backported in the trunk.

So i'll fix that too

--

___
Python tracker 

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



[issue6456] locale.D_* and .T_* are int, not string

2009-07-11 Thread Georg Brandl

Georg Brandl  added the comment:

I moved the constants' description into the nl_langinfo() description
and clarified their use in r73945.

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

___
Python tracker 

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



[issue6269] threading documentation makes no mention of the GIL

2009-07-11 Thread Georg Brandl

Changes by Georg Brandl :


--
assignee: georg.brandl -> jnoller

___
Python tracker 

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



[issue6459] distutils.command.build_ext.get_export_symbols should use the "PyInit" prefix rather then "init"

2009-07-11 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

The bug also exists in 2.6 so I'm backporting the fix

--
title: Lib/distutils\tests\test_build_ext.py fails on VC6 -> 
distutils.command.build_ext.get_export_symbols should use the "PyInit" prefix 
rather then "init"
versions: +Python 2.6, Python 2.7

___
Python tracker 

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



[issue6459] distutils.command.build_ext.get_export_symbols should use the "PyInit" prefix rather then "init"

2009-07-11 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

done in r73946, r73947 (2.6), r73948 (py3k), r73949 (3.1)

Thanks !

(also, the build_ext module is now perfectly similar between 2.x and 3.x)

--
status: open -> closed

___
Python tracker 

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



[issue6459] distutils.command.build_ext.get_export_symbols should use the "PyInit" prefix rather then "init"

2009-07-11 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

Well, I'm not sure but for example,
Modules/_randomemodule.c uses "init_random" on trunk. Is it OK to 
use "PyInit" on trunk too?

--

___
Python tracker 

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



[issue6459] distutils.command.build_ext.get_export_symbols should use the "PyInit" prefix rather then "init"

2009-07-11 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

What's the logic behind PyInit_ ? 

For instance Modules/_bsddb.c uses PyInit, so does Modules/zlibmodule.c

--
status: closed -> open

___
Python tracker 

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



[issue6459] distutils.command.build_ext.get_export_symbols should use the "PyInit" prefix rather then "init"

2009-07-11 Thread Hirokazu Yamamoto

Hirokazu Yamamoto  added the comment:

bsddb seems to use #if directive to switch function name. 
("init_bsddb"  on trunk)

#if (PY_VERSION_HEX < 0x0300)
DL_EXPORT(void) init_bsddb(void)
#else
PyMODINIT_FUNC  PyInit__bsddb(void)/* Note the two underscores */
#endif

And zlibmodule.c, there is following line on line number 56.
#define PyInit_zlib initzlib

--

___
Python tracker 

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



[issue3982] support .format for bytes

2009-07-11 Thread Arjen Nienhuis

Arjen Nienhuis  added the comment:

There are many binary formats that use ASCII numbers.

'HTTP chunking' uses ASCII mixed with binary (octets).

With 2.6 you could write:

def chunk(block):
return b'{0:x}\r\n{1}\r\n'.format(len(block), block)

With 3.0 you'd have to write this:

def chunk(block):
return format(len(block), 'x').encode('ascii') + b'\r\n' + block +
b'\r\n'

You cannot convert to ascii at the end of the pipeline as there are
bytes > 127 in the data blocks.

--
nosy: +arjennienhuis

___
Python tracker 

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



[issue6460] test failure in test_xmlrpc on Gentoo in trunk

2009-07-11 Thread R. David Murray

R. David Murray  added the comment:

OK, the test passes on my box now.  But from the way the test is phrased
it sounds like there is still a small risk that the test will fail in
unusual timing circumstances?

--

___
Python tracker 

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



[issue3982] support .format for bytes

2009-07-11 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> def chunk(block):
> return format(len(block), 'x').encode('ascii') + b'\r\n' + block +
> b'\r\n'
> 
> You cannot convert to ascii at the end of the pipeline as there are
> bytes > 127 in the data blocks.

I wouldn't write it in such a complicated way. Instead, use

def chunk(block):
   return hex(len(block)).encode('ascii') + b'\r\n' + block + b'\r\n'

This doesn't need any format call, and describes adequatly how the
protocol works: send an ASCII-encoded hex length, send CRLF, send
the block, then send another CRLF. Of course, I would probably write
that into the socket right away, rather than copying it into a different
bytes object first.

--

___
Python tracker 

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



[issue6460] test failure in test_xmlrpc on Gentoo in trunk

2009-07-11 Thread R. David Murray

R. David Murray  added the comment:

By the way, although my system doesn't show it, the Gentoo 3.x buildbot
shows the error.  I'm sure you were going to forward port the patch
anyway :)

--

___
Python tracker 

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



[issue3982] support .format for bytes

2009-07-11 Thread Arjen Nienhuis

Arjen Nienhuis  added the comment:

> def chunk(block):
>   return hex(len(block)).encode('ascii') + b'\r\n' + block + b'\r\n'

hex(10) returns '0xa' instead of 'a'.

> This doesn't need any format call, and describes adequatly how the
> protocol works: send an ASCII-encoded hex length, send CRLF, send
> the block, then send another CRLF. Of course, I would probably write
> that into the socket right away, rather than copying it into a different
> bytes object first.

The point is that need to convert to ascii for each int that you send.
You cannot just wrap the socket with an encoding. This makes porting
difficult.

--

___
Python tracker 

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



[issue6462] bsddb3 intermittent test failures

2009-07-11 Thread R. David Murray

New submission from R. David Murray :

The buildbots periodically report failures in the bsddb3 test suite. 
These are not reproducible and presumably are timing-based.  It would be
best if the tests could be made to pass consistently, to make the
buildbot output more useful.

Here is one such failure that I see on a semi-regular basis on trunk
(this happens in my own tests runs as well, also not consistently):

test_bsddb3
Berkeley DB 4.7.25: (June 30, 2009)
Test path prefix:  /tmp/z-test_bsddb3-11362
test test_bsddb3 failed -- Traceback (most recent call last):
  File "/home/rdmurray/python/trunk/Lib/bsddb/test/test_replication.py",
line 134, in test01_basic_replication
self.assertTrue(time.time()

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



[issue1921] Confusing Descrintro example

2009-07-11 Thread Guido van Rossum

Guido van Rossum  added the comment:

I'm guessing you weren't ready for learning about metaclasses if you
didn't get the fact that 'name' was the loop control variable in the two
different loops.  The example is only 11 lines long!

Still, I'm fine with the two suggested renames.

I'm not fine with rewriting the example using modern constructs, since
it is part of the docs for Python 2.2.  Perhaps the doc is still useful
but then it should be first moved into the regular doc tree and *then*
adapted to modern times (and we can't really release that version until
2.7 and 3.2 are released).

Unfortunately I do not have a checkout of the website handy any more (or
I can't remember where I put it).  Maybe one of the webmasters can make
the suggested fixes?

The fixed code that I agree with is:

class autoprop(type):
def __init__(cls, name, bases, dict):
super(autoprop, cls).__init__(name, bases, dict)
props = {}
for member in dict.keys():
if member.startswith("_get_") or member.startswith("_set_"):
props[member[5:]] = 1
for prop in props.keys():
fget = getattr(cls, "_get_%s" % prop, None)
fset = getattr(cls, "_set_%s" % prop, None)
setattr(cls, prop, property(fget, fset))

--

___
Python tracker 

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



[issue3982] support .format for bytes

2009-07-11 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

> hex(10) returns '0xa' instead of 'a'.

Ah, right. So I would still use

   '{0:x}'.format(100).encode("ascii")

rather than the format builtin format function. Actually, I would
probably use

  ('%x' % len(bytes)).encode("ascii")

> The point is that need to convert to ascii for each int that you send.
> You cannot just wrap the socket with an encoding. This makes porting
> difficult.

This I don't understand. What porting becomes more difficult?
>From 2.x to 3.x? Why do you have any .format calls in your code that you
want to port - .format was only added in 2.6, so if you want to support
2.x, you surely are not using .format, are you?

--

___
Python tracker 

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



[issue6459] distutils.command.build_ext.get_export_symbols should use the "PyInit" prefix rather then "init"

2009-07-11 Thread Georg Brandl

Georg Brandl  added the comment:

The "PyInit_" prefix is only to be used in Python 3, it is part of PEP 3121.

Please revert changes to trunk/2.6 that assume the "PyInit_" name.

--
nosy: +georg.brandl

___
Python tracker 

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



[issue6459] distutils.command.build_ext.get_export_symbols should use the "PyInit" prefix rather then "init"

2009-07-11 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

Thanks for the explanation, I've reverted the change on 2.x.

--
status: open -> closed
versions:  -Python 2.6, Python 2.7

___
Python tracker 

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



[issue6463] IDLE with Tk-Cocoa: Edit, format menus hang

2009-07-11 Thread Kevin Walzer

New submission from Kevin Walzer :

In running IDLE against a build of Tk-Cocoa (8.5.7) on OS X, the edit and 
format menus sometimes hang and require a force-quit of IDLE. This happens 
when I try to paste text, and also when trying to format selections of 
text with indentation, etc. I've looked closely at the code for 
Bindings.py, EditorWindow.py, PyShell.py, and macOSXSupport.py, and can 
find no obvious reason for these problems. I am confident that the problem 
is not with Tk-Cocoa itself, as copy, pasting, etc. in a basic Tkinter 
text widget presents no problems, but resides instead somewhere in IDLE's 
code and how it interacts with the Tk-Cocoa build. I'm testing against 
Python 2.6.2.

--
components: IDLE
messages: 90431
nosy: wordtech
severity: normal
status: open
title: IDLE with Tk-Cocoa: Edit, format menus hang
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



[issue6464] test_normalization failures due to truncated NormalizationTest.txt file

2009-07-11 Thread R. David Murray

New submission from R. David Murray :

I worked for a while tracking down a mysterious failure in
test_normalization on my machine.  I eventually discovered that a clean
checkout did not exhibit the problem.  A distclean on my original
checkout did not fix the problem.  By doing a diff I finally figured out
that the NormalizationTest.txt file is (a) downloaded the first time the
test is run and (b) not removed afterward and (c) not removed by distclean.

How I wound up with a truncated file I don't know, nor am I quite sure
what the best solution to this little confusion is.  It seems very odd
that a file is dumped and left in the CWD by a test.

--
components: Tests
keywords: easy
messages: 90432
nosy: r.david.murray
priority: low
severity: normal
stage: needs patch
status: open
title: test_normalization failures due to truncated NormalizationTest.txt file
type: behavior
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



[issue6464] test_normalization failures due to truncated NormalizationTest.txt file

2009-07-11 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +lemburg, loewis

___
Python tracker 

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



[issue6440] 2to3: convert deprecated string.maketrans to str.maketrans

2009-07-11 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution:  -> rejected

___
Python tracker 

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



[issue6465] email.feedparser regular expression bug (NLCRE_crack)

2009-07-11 Thread jkg

New submission from jkg :

If the parser is fed a chunk which ends with '\r' and the next chunk
begins with '\n', it incorrectly parses this into a line ending with
'\r' and an empty line ending with '\n' instead of a single line ending
with '\r\n'.

Test attached. Patch to follow.

--
components: Library (Lib)
files: test_nlcre.py
messages: 90433
nosy: barry, jkg, tony_nelson
severity: normal
status: open
title: email.feedparser regular expression bug (NLCRE_crack)
type: behavior
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, Python 3.1
Added file: http://bugs.python.org/file14484/test_nlcre.py

___
Python tracker 

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



[issue6465] email.feedparser regular expression bug (NLCRE_crack)

2009-07-11 Thread jkg

jkg  added the comment:

Patch.

--
keywords: +patch
Added file: http://bugs.python.org/file14485/nlcre.patch

___
Python tracker 

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



[issue6460] test failure in test_xmlrpc on Gentoo in trunk

2009-07-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

No, this should take care of it.  In order for the client side request to 
succeed, the server must have cycled through the previous request and 
updated its statistic.  It is only the statistic for the final request tha 
t may be missed.  And yes, I was going to fw. port, I was waiting for your 
confirmation.  Cheers.

--

___
Python tracker 

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



[issue6460] test failure in test_xmlrpc on Gentoo in trunk

2009-07-11 Thread Kristján Valur Jónsson

Kristján Valur Jónsson  added the comment:

merged testsuite fix to py3k in revision 73961

--

___
Python tracker 

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



[issue1921] Confusing Descrintro example

2009-07-11 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

I've now updated the website to Guido's new code.

--
nosy: +benjamin.peterson
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue6464] test_normalization failures due to truncated NormalizationTest.txt file

2009-07-11 Thread R. David Murray

R. David Murray  added the comment:

Benjamin fixed this in r73962 by having the test support routine put the
files in Lib/test/data, and adding a rule to the distclean target to
empty that directory.

--
nosy: +benjamin.peterson
status: open -> closed

___
Python tracker 

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



[issue6464] test_normalization failures due to truncated NormalizationTest.txt file

2009-07-11 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution:  -> fixed

___
Python tracker 

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