[issue6528] builtins colored as keyword at beginning of line

2009-07-21 Thread Ezio Melotti

Ezio Melotti  added the comment:

In Python 3, True, False and None are keywords, so the orange should be
correct. It should be orange also when you do "foo = True" though.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue6499] Can't import xmlrpclib, DocXMLRPCServer and SimpleXMLRPCServer when zlib is not available

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

Kristján Valur Jónsson  added the comment:

I found one problem in test_docxmlrpc.py, a missing "import socket" at 
the top (for the socket.timeout exception handler).
Please add that, and see what happens.

But there seems to be a problem with the error handing in your build.  
probably, sys.stderr is messed up somehow.  You could try putting a 
breakpoint in line 444 of threadmodule.c and get to the bottom of it.

But to short circuit that,  
try adding an "import sys" and then in the finally clause (around line 
54) add "sys.stderr = sys.__stderr__" and see if you get better error 
output.

--

___
Python tracker 

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



[issue6510] zipfile: OSError File exists

2009-07-21 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

This was already fixed with issue6050, and will be part of 2.6.3.
Thanks for the report

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

___
Python tracker 

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



[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.

2009-07-21 Thread Graham Dumpleton

New submission from Graham Dumpleton :

I am seeing a crash within Py_Finalize() with Python 3.0 in mod_wsgi. It looks 
like the 
patches for issue-4200 were not adequate and that this wasn't picked up at the 
time.

This new problem I am seeing looks like it may be linked to where the 'atexit' 
module is 
initialised/imported in a sub interpreter but never imported in the main 
interpreter. I can 
avoid the crash by having:

PyImport_ImportModule("atexit");

Py_Finalize();

At a guess, the problem is because in atexit_callfuncs():

module = PyState_FindModule(&atexitmodule);
if (module == NULL)
return;

still returns a module for case where imported in a sub interpreter but not in 
main 
interpreter, so doesn't return, but then code which follows:

modstate = GET_ATEXIT_STATE(module);

if (modstate->ncallbacks == 0)
return;

returns NULL for modstate for the main interpreter as PyInit_atexit() had never 
been called 
for the main interpreter as the 'atexit' module was never imported within that 
interpreter.

The fix would appear to be to check modstate for being NULL and return. Ie.,

module = PyState_FindModule(&atexitmodule);
if (module == NULL)
return;
modstate = GET_ATEXIT_STATE(module);

if (modstate == NULL)
return;

if (modstate->ncallbacks == 0)
return;

The only thing I am uncertain about is why PyState_FindModule() would return an 
object. I 
cant find any documentation about that function so not entirely sure what it is 
meant to do. 
I would have thought it would be returning data specific to the interpreter, 
but if never 
imported in that interpreter, why would there still be an object recorded.

BTW, I have marked this as for Python 3.1 as well, but haven't tested it on 
that. The code in 
'atexit' module doesn't appear to have changed though so assuming it will die 
there as well.

For now am using the workaround in mod_wsgi.

--
components: Interpreter Core
messages: 90753
nosy: grahamd
severity: normal
status: open
title: atexit_callfuncs() crashing within Py_Finalize() when using multiple 
interpreters.
type: crash
versions: Python 3.0, Python 3.1

___
Python tracker 

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



[issue4200] atexit module not safe in Python 3.0 with multiple interpreters

2009-07-21 Thread Graham Dumpleton

Graham Dumpleton  added the comment:

Have created issue6531 for my new issue related to this patch.

--

___
Python tracker 

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



[issue6493] Can not set value for structure members larger than 32 bits

2009-07-21 Thread R. David Murray

R. David Murray  added the comment:

One of the new tests in r74134 is failing on my box (Gentoo x86), and on
a number of the buildbots:

test test_ctypes failed -- Traceback (most recent call last):
  File "/home/rdmurray/python/trunk/Lib/ctypes/test/test_bitfields.py",
line 255, in test_uint64
self.failUnlessEqual(x.a, 10)
AssertionError: 0L != 10

--
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



[issue6493] Can not set value for structure members larger than 32 bits

2009-07-21 Thread R. David Murray

Changes by R. David Murray :


--
priority:  -> normal
stage:  -> commit review
type:  -> behavior
versions: +Python 2.7, Python 3.1, Python 3.2 -Python 2.5, Python 3.0

___
Python tracker 

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



[issue6493] Can not set value for structure members larger than 32 bits

2009-07-21 Thread Thomas Heller

Thomas Heller  added the comment:

> One of the new tests in r74134 is failing on my box (Gentoo x86), and on
> a number of the buildbots:

I've seen that, but do not yet have a patch.

--
title: Can not set value for structure members larger than 32 bits -> Can not 
set value for structure members larger than 32bits

___
Python tracker 

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



[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.

2009-07-21 Thread R. David Murray

R. David Murray  added the comment:

I strongly recommend you move to 3.1.  3.0 will not be getting any more
bug patches.

--
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




[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.

2009-07-21 Thread Graham Dumpleton

Graham Dumpleton  added the comment:

As a provider of software that others use I am just making mod_wsgi usable 
with everything so users can use whatever they want. You telling me to use 
Python 3.1 isn't going to stop people from using Python 3.0 if that is 
what they happen to have installed. Just look at how many people still use 
really old Python 2.X versions. Ultimately I don't care which Python 
version it is fixed in as I have the work around anyway.

--

___
Python tracker 

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



[issue6531] atexit_callfuncs() crashing within Py_Finalize() when using multiple interpreters.

2009-07-21 Thread R. David Murray

R. David Murray  added the comment:

I'm sorry, I wasn't clear.  We are recommending that no one use Python
3.0 for production.  Python 3.1 fixed some significant performance
issues.  We are hoping that distribution packagers will not ship 3.0,
but will ship 3.1 instead.  But if you want to support 3.0, that's a
fine thing.

I should have just kept my mouth shut, especially since I don't have any
input on the bug itself ;)

--

___
Python tracker 

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



[issue6530] Regression on "python -Wi" crash

2009-07-21 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Fixed in r74139

--
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



[issue6532] thread.get_ident() should return unsigned value

2009-07-21 Thread Wojciech Lichota

New submission from Wojciech Lichota :

In glibc library (on linux) pthread_t is defined as:

typedef unsigned long int pthread_t;

But python thread module interprets this value as signed long. 

Reproduce:
>>> import thread
>>> thread.get_ident()
In some cases it returns negative value.
Checked in python 2.4, 2.5, 2.6

Proposal:
In my opinion code that cast value returned by pthread_self() should be
changed (see: Python/thread_pthread.h).

Other possibility is to change only returned value by get_ident
function. In this case it should use PyLong_FromUnsignedLong (see:
Modules/threadmodule.c).

Background:
logging module uses 'thread.get_ident()' to save thread_id in logs. If
the same application uses some C library that also writes in log file
some info with thread_id, in some situations this numbers are diffrent.
This complicate logs analyze.

--
components: Library (Lib)
messages: 90761
nosy: sargo
severity: normal
status: open
title: thread.get_ident() should return unsigned value
versions: Python 2.4, Python 2.5, Python 2.6

___
Python tracker 

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



[issue6236] os.popen causes illegal seek on AIX in Python 3.1rc

2009-07-21 Thread nestor

nestor  added the comment:

Maybe this has something to do with it?

Python 3.1 (r31:73572, Jul  9 2009, 16:28:28) [C] on aix5
Type "help", "copyright", "credits" or "license" for more information.
>>> open("/dev/tty","a").seekable()
True
>>>

--

___
Python tracker 

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



[issue6533] Make test_xmlrpc_net functional in the absence of time.xmlrpc.com

2009-07-21 Thread R. David Murray

New submission from R. David Murray :

It seems like time.xmlrpc.com is gone (again?).  That service was
provided by userland.com, who have an xmlrpc server that they mention in
their documentation examples (see for example
http://frontier.userland.com/changes/kernel71) which argues that they
will probably keep the service alive.

The attached patch adds a second test to test_xmlrpc_net to access the
example service directly at userland, and changes both tests to raise
unittest.SkipTest if the service is not accessible.

--
assignee: r.david.murray
components: Tests
files: test_xmlrpc_net.patch
keywords: easy, patch, patch
messages: 90763
nosy: r.david.murray
priority: low
severity: normal
stage: patch review
status: open
title: Make test_xmlrpc_net functional in the absence of time.xmlrpc.com
type: behavior
versions: Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14528/test_xmlrpc_net.patch

___
Python tracker 

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



[issue6534] os.makedirs returns EACCES for "C:\"

2009-07-21 Thread Luke-Jr

New submission from Luke-Jr :

Should return EEXIST or EISDIR provided C:\ actually exists

--
components: Windows
messages: 90764
nosy: luke-jr
severity: normal
status: open
title: os.makedirs returns EACCES for "C:\"
type: behavior
versions: Python 2.5

___
Python tracker 

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



[issue6493] Can not set value for structure members larger than 32 bits

2009-07-21 Thread Thomas Heller

Thomas Heller  added the comment:

ctypes_workaround_2.patch from ocean-city seems to fix it so I'll apply
that.

--
title: Can not set value for structure members larger than 32   bits -> Can not 
set value for structure members larger than 32 bits

___
Python tracker 

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



[issue5596] memory leaks in py3k

2009-07-21 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

With the py3k branch head (r74140):

test_urllib leaked [6, 4] references, sum=10
test_urllib2 leaked [227, 227] references, sum=454

--
title: memory leaks in 3.1 -> memory leaks in py3k
versions: +Python 3.2 -Python 3.1

___
Python tracker 

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



[issue6535] optparse required field for Options

2009-07-21 Thread Daniel Kaplun

New submission from Daniel Kaplun :

In the second example to allow usage of the required field for options,
it seems as if you already have all you need to implement the feature
into optparse. I modified it a bit to allow OptionGroups:

class Option(optparse.Option):
ATTRS = optparse.Option.ATTRS + ['required']

def _check_required(self):
if self.required and not self.takes_value():
raise OptionError(
"required flag set for option that doesn't take 
a value",
 self)

# Make sure _check_required() is called from the constructor!
CHECK_METHODS = optparse.Option.CHECK_METHODS + [_check_required]

def process(self, opt, value, values, parser):
optparse.Option.process(self, opt, value, values, parser)
parser.option_seen[self] = 1

class OptionParser(optparse.OptionParser):
def _init_parsing_state(self):
optparse.OptionParser._init_parsing_state(self)
self.option_seen = {}

def check_values(self, values, args):
for option in self.option_list + sum((optiongroup.option_list 
for
optiongroup in self.option_groups), []):
if isinstance(option, Option) and option.required and 
not
self.option_seen.has_key(option):
self.error("%s not supplied" % (option, ))
return (values, args)

The question: why hasn't your existing example been merged with the
OptionParse code to allow the required field for options?

--
components: Extension Modules
messages: 90767
nosy: mindvirus
severity: normal
status: open
title: optparse required field for Options
versions: Python 2.4, Python 2.5, Python 2.6, Python 2.7, Python 3.0, 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



[issue6535] optparse required field for Options

2009-07-21 Thread Daniel Kaplun

Changes by Daniel Kaplun :


--
type:  -> feature request

___
Python tracker 

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



[issue3311] block operation on closed socket/pipe for multiprocessing

2009-07-21 Thread STINNER Victor

STINNER Victor  added the comment:

ping? The bug is still open and valid.

--
versions: +Python 2.7, Python 3.0, 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



[issue6536] urllib2 howto contains typo

2009-07-21 Thread Kurt McKee

New submission from Kurt McKee :

At ,
"HHTPBasicAuthHandler" should of course be "HTTP..."

--
assignee: georg.brandl
components: Documentation
messages: 90769
nosy: georg.brandl, kurtmckee
severity: normal
status: open
title: urllib2 howto contains typo

___
Python tracker 

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



[issue6537] string.split shouldn't split on non-breaking spaces

2009-07-21 Thread Eric Promislow

New submission from Eric Promislow :

ActivePython 2.6.1.1 ...
>>> a = u"abc\x0adef"
>>> a.split()
[u'abc', u'def']
>>>

"\x0a" is a non-breaking space. This behavior means we can't
easily use split() to reflow text.

--
components: Interpreter Core
messages: 90770
nosy: ericp
severity: normal
status: open
title: string.split shouldn't split on non-breaking spaces
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



[issue6537] string.split shouldn't split on non-breaking spaces

2009-07-21 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

split() is usually used to split words. To reflow text, use the textwrap
module.

--
nosy: +benjamin.peterson
resolution:  -> 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



[issue6537] string.split shouldn't split on non-breaking spaces

2009-07-21 Thread Eric Promislow

Eric Promislow  added the comment:

Thanks.  For the record, I want

textwrap.TextWrapper(..., break_long_words=False)

or it will break after a non-breaking space if that
gives an optimum length.

--
status: closed -> open

___
Python tracker 

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



[issue6536] urllib2 howto contains typo

2009-07-21 Thread Ezio Melotti

Changes by Ezio Melotti :


--
assignee: georg.brandl -> ezio.melotti
nosy: +ezio.melotti
priority:  -> low
resolution:  -> accepted

___
Python tracker 

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



[issue6537] string.split shouldn't split on non-breaking spaces

2009-07-21 Thread Benjamin Peterson

Changes by 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



[issue6535] optparse required field for Options

2009-07-21 Thread R. David Murray

R. David Murray  added the comment:

Feature requests can only go into releases under development.

No guarantees, but if you want to give this a better chance of getting
in a patch against trunk including tests would be a minimum prerequisite.

Alternatively or in addition you could help review argparse for
inclusion into the stdlib (see issue 6247; I know the issue is closed
but it could still be moved forward if enough interest is expressed).

--
components: +Library (Lib) -Extension Modules
keywords: +easy
nosy: +r.david.murray
priority:  -> normal
stage:  -> test needed
versions:  -Python 2.4, Python 2.5, Python 2.6, Python 3.0, Python 3.1

___
Python tracker 

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



[issue6536] urllib2 howto contains typo

2009-07-21 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed in r74148 (trunk) and r74149 (py3k).
Thanks!

--
resolution: accepted -> fixed
stage:  -> committed/rejected

___
Python tracker 

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



[issue6536] urllib2 howto contains typo

2009-07-21 Thread Ezio Melotti

Changes by Ezio Melotti :


--
status: open -> closed

___
Python tracker 

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



[issue6534] os.makedirs returns EACCES for "C:\"

2009-07-21 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

EACCESS is the error code returned by the underlying mkdir system call.
os.mkdir won't change this, as long as an OSError is raised.

You should use another way to check that the directory exists, like 
os.path.isdir("c:\\")

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

___
Python tracker 

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



[issue6535] optparse required field for Options

2009-07-21 Thread Daniel Kaplun

Changes by Daniel Kaplun :


--
keywords: +patch
Added file: http://bugs.python.org/file14529/optparse.py.diff

___
Python tracker 

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



[issue6535] optparse required field for Options

2009-07-21 Thread Daniel Kaplun

Changes by Daniel Kaplun :


Added file: http://bugs.python.org/file14530/testcase.py

___
Python tracker 

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



[issue6538] MatchObject is not a hyperlink in the 're' module documentation

2009-07-21 Thread R. David Murray

New submission from R. David Murray :

In the re documentation MatchObject is marked up as a class, but since
there's no declaration of it as a class (it's a section instead) it
doesn't get turned into a hyperlink.  It would be useful if it did link
to the appropriate section.

--
assignee: georg.brandl
components: Documentation
keywords: easy
messages: 90776
nosy: georg.brandl, r.david.murray
priority: low
severity: normal
stage: needs patch
status: open
title: MatchObject is not a hyperlink in the 're' module documentation
versions: Python 2.6, 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



[issue6535] optparse required field for Options

2009-07-21 Thread R. David Murray

R. David Murray  added the comment:

What we are looking for in the way of tests is unit tests to add to
test_optparse.  Another piece that I forgot about that we'll need is a
documentation patch.

Finally, it will be easier to review the patch if you don't make other
changes in the patch.  Your PEP 8 changes are good in principle, but
they make it harder to review the patch.

--

___
Python tracker 

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



[issue6539] unittest dir not created during install

2009-07-21 Thread Kurt B. Kaiser

New submission from Kurt B. Kaiser :

rev 74095
http://svn.python.org/view?view=rev&revision=74095

didn't create the unittest dir during installation.

unittest isn't installed in its final location.

--
assignee: benjamin.peterson
components: Build
files: Makefile.pre.in.patch
keywords: needs review, patch
messages: 90778
nosy: benjamin.peterson, kbk
priority: high
severity: normal
stage: patch review
status: open
title: unittest dir not created during install
versions: Python 2.7
Added file: http://bugs.python.org/file14531/Makefile.pre.in.patch

___
Python tracker 

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



[issue6534] os.makedirs returns EACCES for "C:\"

2009-07-21 Thread Luke-Jr

Luke-Jr  added the comment:

At least fix the documentation, then...

--

___
Python tracker 

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



[issue6539] unittest dir not created during install

2009-07-21 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

Fixed in r74150.

--
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



[issue6535] optparse required field for Options

2009-07-21 Thread Daniel Kaplun

Daniel Kaplun  added the comment:

I have not a single clue how to unit test.

What do you mean by documentation patch? Do you want me to update the
documentation within the file to reflect changes?

--

___
Python tracker 

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



[issue6499] Can't import xmlrpclib, DocXMLRPCServer and SimpleXMLRPCServer when zlib is not available

2009-07-21 Thread Ezio Melotti

Ezio Melotti  added the comment:

sys.stderr looks ok, I tried what you said and I also tried to put some
"assert sys.stderr == sys.__stderr__" here and there and nothing changed.
I commented out the tests one by one and I found out that the first test
alone (test_valid_get_response) is enough to have that error message
(the second alone doesn't seem to show any error).
There's also a comment that says that response.read() is necessary but
nothing changes if I remove that line.
I also noticed that if I put a print at the end of the finally block the
error message doesn't appear anymore.
I didn't tried to debug threadmodule.c.

--

___
Python tracker 

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



[issue6535] optparse required field for Options

2009-07-21 Thread R. David Murray

R. David Murray  added the comment:

Well, if you get check out the current trunk via svn (as described in
the developer's faq linked from http://www.python.org/dev) and you look
at what Lib/test/test_optparse.py currently does, you might find it is
not too hard to add some new cases to test the new code.  Then in
Doc/library/optparse.rst, you make appropriate changes to the
documentation RestructuredTest source code, and post everything in a
single patch.

If you don't want to do all this that's fine, the ticket will sit here
until someone comes along who wants to move it forward ;)

Thanks for taking an interest in this.

--

___
Python tracker 

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



[issue6499] Can't import xmlrpclib, DocXMLRPCServer and SimpleXMLRPCServer when zlib is not available

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

Kristján Valur Jónsson  added the comment:

Well, I think the only way to move forward with this is to try to 
figure out what the actual error is.  Something is wrong in printing it 
out to stderr, and it would be helpful to understand why it is not 
being output.  Perhaps this is some buffering issue.  You could try to 
redirect stderr to a file, using something like this i the finally 
clause:
sys.stderr = open("/tmp/err.txt", "w", 0)

--

___
Python tracker 

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



[issue6534] os.makedirs returns EACCES for "C:\"

2009-07-21 Thread Amaury Forgeot d'Arc

Amaury Forgeot d'Arc  added the comment:

The documentation carefully don't specify the possible values of errno of 
the exceptions. What do you want to fix?

--

___
Python tracker 

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



[issue6540] bytearray.translate(): error in error handling

2009-07-21 Thread STINNER Victor

New submission from STINNER Victor :

bytearray.translate() crash if:
 * first argument was converted to a buffer but the buffer length is not 256
bytes
 * first argument is valid, but the second argument can not be converted to a
buffer

The crash occurs because PyBuffer_Release(&vdel) is called whereas vdel
buffer is not initialized.

Example with Python3:

lisa$ ./python
Python 3.2a0 (py3k:74029M, Jul 17 2009, 02:29:48)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x=bytearray(b'xyz')
>>> x.translate(b'x', 1)
Traceback (most recent call last):
  File "", line 1, in 
ValueError: translation table must be 256 characters long
>>> x.translate(b'x', 1)
Erreur de segmentation

Attached patch fixes the two cases and add an unit test for the first case. As
you can see in the example, it's an Heisenbug :-) (compile in debug bug to get
reproductible crash)

--
components: Interpreter Core
files: bytearray.patch
keywords: patch
messages: 90786
nosy: haypo
severity: normal
status: open
title: bytearray.translate(): error in error handling
versions: Python 2.6, Python 2.7, Python 3.0, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file14532/bytearray.patch

___
Python tracker 

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



[issue6540] bytearray.translate(): error in error handling

2009-07-21 Thread STINNER Victor

Changes by STINNER Victor :


Removed file: http://bugs.python.org/file14532/bytearray.patch

___
Python tracker 

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



[issue6540] bytearray.translate(): error in error handling

2009-07-21 Thread STINNER Victor

STINNER Victor  added the comment:

Oops, my first patch was broken (redefine "test_bin", instead of using a
different method name). The name patch tests both cases (the two crashs).

--
Added file: http://bugs.python.org/file14533/bytearray-2.patch

___
Python tracker 

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



[issue6499] Can't import xmlrpclib, DocXMLRPCServer and SimpleXMLRPCServer when zlib is not available

2009-07-21 Thread Ezio Melotti

Ezio Melotti  added the comment:

Same message in the terminal and nothing in the file.

Can you reproduce it if you run the test several times? Some times I
have to run "./python Lib/test/regrtest.py -v test_docxmlrpc" 15-20 or
even more times before the message appears.

--

___
Python tracker 

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



[issue6540] bytearray.translate(): error in error handling

2009-07-21 Thread Ezio Melotti

Changes by Ezio Melotti :


--
priority:  -> critical
stage:  -> patch review
type:  -> crash

___
Python tracker 

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



[issue6541] SpooledTemporaryFile operates differently to TemporaryFile

2009-07-21 Thread Leon Matthews

New submission from Leon Matthews :

According the docs for the tempfile module, SpooledTemporaryFile()
should operate "exactly as TemporaryFile() does".  However, while
playing around trying to learn the module I found a couple of places
where this is not the case: 

import tempfile

hello = bytes('Hello World!', encoding='utf-8')
tf = tempfile.TemporaryFile()
stf = tempfile.SpooledTemporaryFile()

tf.write(hello)
stf.write(hello)

# (1) Read after write behaviour differs...
>>> print(tf.read())  
b'Hello World'
>>> print(stf.read())
b''

# ...unless you seek first
>>> tf.seek(0)
>>> stf.seek(0)
>>> print(tf.read())
b'Hello World'
>>> print(stf.read())
b'Hello World'


# (2) Name attribute is fragile...
>>> print(tf.name)
3
print(stf.name)
AttributeError: '_io.BytesIO' object has no attribute 'name'

# ...until StringIO object replaced
stf.rollover()
print(stf.name)   # 4

I'm not sure if this should be categorised as a documentation or code
issue. In either case please be gentle -- I'm still just learning Python
(evaluating it as a [now likely] replacement for PHP for web application
development in our company).  I'm filing this bug because, as a
beginner, I was confused by the inconsistency between the docs and the
actual behaviour.

I'd be happy to try and write documentation and/or unit tests about
this, if somebody would be willing to review them for me... :-)

--
components: Library (Lib)
messages: 90789
nosy: leonov
severity: normal
status: open
title: SpooledTemporaryFile operates differently to TemporaryFile
type: behavior
versions: Python 3.1

___
Python tracker 

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



[issue6242] Fix reference leak in io.StringIO

2009-07-21 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Patch committed in r74155 (branches/py3k).

--
resolution:  -> accepted
stage: patch review -> 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



[issue6542] test_os TestInvalidFD.test_closerange causes test_pipes hang in certain circumstances on linux

2009-07-21 Thread R. David Murray

New submission from R. David Murray :

The test sequence "test_ttk_guionly test_os test_pipes" hangs almost
every time when run on Gentoo x86 and Ubuntu x86_64 (at least).  Note
that this is without the gui resource, so the ttk tests aren't being run.

Commenting out test_closerange in TestInvalidFD in test_os clears the
hang.  Playing around with which module imports are commented out in
test_ttk_guionly can clear the hang, but test_pipes then produces the
following errors:

==
ERROR: testSimplePipe1 (test.test_pipes.SimplePipeTests)
--
Traceback (most recent call last):
  File "/home/rdmurray/python/py3k/Lib/test/test_pipes.py", line 23, in
testSimplePipe1
f = t.open(TESTFN, 'w')
  File "/home/rdmurray/python/py3k/Lib/pipes.py", line 148, in open
return self.open_w(file)
  File "/home/rdmurray/python/py3k/Lib/pipes.py", line 168, in open_w
return os.popen(cmd, 'w')
  File "/home/rdmurray/python/py3k/Lib/os.py", line 636, in popen
bufsize=buffering)
  File "/home/rdmurray/python/py3k/Lib/subprocess.py", line 646, in __init__
errread, errwrite)
  File "/home/rdmurray/python/py3k/Lib/subprocess.py", line 1138, in
_execute_child
os.close(errpipe_read)
OSError: [Errno 9] Bad file descriptor

==
FAIL: testSimplePipe2 (test.test_pipes.SimplePipeTests)
--
Traceback (most recent call last):
  File "/home/rdmurray/python/py3k/Lib/test/test_pipes.py", line 33, in
testSimplePipe2
self.assertEqual(open(TESTFN2).read(), 'HELLO WORLD #2')
AssertionError: '' != 'HELLO WORLD #2'


The first of these appears almost every time, the second one seldom. 
Occasinally both tests pass.

--
components: Tests
messages: 90791
nosy: r.david.murray
priority: normal
severity: normal
stage: needs patch
status: open
title: test_os TestInvalidFD.test_closerange causes test_pipes hang in certain 
circumstances on linux
type: behavior
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



[issue6360] Simplify string decoding in xmlrpc.client.

2009-07-21 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Patch committed in r74156 (branches/py3k).

--
resolution:  -> accepted
stage: patch review -> 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



[issue6542] test_os TestInvalidFD.test_closerange causes test_pipes hang in certain circumstances on linux

2009-07-21 Thread R. David Murray

R. David Murray  added the comment:

It appears that TestInvalidFD.test_closerange is in fact closing a valid
file descriptor in this case.  I'm not sure how to fix the test...nor
why the close produced the results it does.

--

___
Python tracker 

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



[issue6423] The cgi docs should advertize using "in" instead of "has_key"

2009-07-21 Thread Ezio Melotti

Ezio Melotti  added the comment:

I rephrased the doc and removed has_key at all, fixed the rst markup for
'in' and improved a little the example.
If the attached patch is ok I'll commit it.

The py3 doc is slightly different, they should probably be the same (I
prefer 'in' over '__contains__' and my version of the example, the text
is pretty much the same in both).

Georg?

--
keywords: +needs review
stage:  -> patch review
Added file: http://bugs.python.org/file14534/issue6423.patch

___
Python tracker 

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



[issue6241] Better type checking for the arguments of io.StringIO

2009-07-21 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Committed in r74157 (branches/py3k).

--
resolution:  -> accepted
stage: patch review -> 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



[issue6542] test_os TestInvalidFD.test_closerange causes test_pipes hang in certain circumstances on linux

2009-07-21 Thread R. David Murray

R. David Murray  added the comment:

Here's another buildbot failure that's probably the same thing:

http://www.python.org/dev/buildbot/all/x86%20osx.5%203.x/builds/1220

--

___
Python tracker 

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



[issue6218] Make io.BytesIO and io.StringIO picklable.

2009-07-21 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Committed in r74158 (branches/py3k).

--
resolution:  -> accepted
stage: patch review -> 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



[issue6423] The cgi docs should advertize using "in" instead of "has_key"

2009-07-21 Thread R. David Murray

R. David Murray  added the comment:

Your patch looks good.  I was going to opine that mentioning
__contains__ was good because it would lead the reader to understand how
'in' is supported, but since the len function is referenced but that
doesn't let you learn about __len__, you might as well be consistent and
talk about in and not __contains__.  So I'd vote for changing the 3.x
docs to match.

I agree with you about the example.

--
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



[issue6542] test_os TestInvalidFD.test_closerange causes test_pipes hang in certain circumstances on linux

2009-07-21 Thread R. David Murray

R. David Murray  added the comment:

Patch to skip test if it can't get a range of invalid file descriptors
to test.  The test sequence passes with this patch in place.

--
assignee:  -> r.david.murray
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file14535/issue6542.patch

___
Python tracker 

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



[issue6151] Make PyDescr_COMMON conform to standard C

2009-07-21 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Committed in r74159 (branches/py3k).

--
resolution:  -> accepted
stage: patch review -> 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



[issue6542] test_os TestInvalidFD.test_closerange causes test_pipes hang in certain circumstances on linux

2009-07-21 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Oh, nice catch. That patch looks fine. However, I would probably add a
comment why the fstat checks are required.

--
nosy: +alexandre.vassalotti

___
Python tracker 

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



[issue4509] bugs in array.array with exports (buffer protocol)

2009-07-21 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Closing as I don't see any other bugs in this issue to fix.

--
resolution:  -> fixed
stage: needs patch -> 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