[issue7712] Add a context manager to change cwd in test.test_support and run the test suite in a temp dir.

2010-02-13 Thread Florent Xicluna

Florent Xicluna  added the comment:

"Complex is better than complicated... Special cases aren't special enough to 
break the rules."

The module "regrtest" is complex enough. We don't need to keep useless hacks 
inside.
It would be more interesting to replace the hack with some words, or an 
assertion, and understand the real (or hypothetic) issue behind this hack.

Eventually, if we keep these hacks around, it may hide real bugs.

--

___
Python tracker 

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



[issue3132] implement PEP 3118 struct changes

2010-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Some of the proposed struct module additions look far from straightforward;  I 
find that section of the PEP significantly lacking in details and motivation.

"Unpacking a long-double will return a decimal object or a ctypes long-double."

Returning a Decimal object here doesn't make a lot of sense, since Decimal 
objects aren't generally compatible with floats.  And ctypes long double 
objects don't seem to exist, as far as I can tell.  It might be better not to 
add this code.

Another bit that's not clear to me:  how is unpacking an object pointer 
expected to work, and how would it typically be used?  What if the unpacked 
pointer no longer points to a valid Python object?  How would this work in 
other Python implementations?

For the 'X{}' format (pointer to a function), is this supposed to mean a Python 
function or a C function?

What's a 'specific pointer'?

--

___
Python tracker 

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



[issue3132] implement PEP 3118 struct changes

2010-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Whoops.  ctypes does have long double, of course.  Apologies.

--

___
Python tracker 

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



[issue1023290] Conversion of longs to bytes and vice-versa.

2010-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

A couple of questions for the backport:

(1) should the 'signed' parameter remain keyword-only in 2.7?  I'd say yes, to 
avoid issues when forward-porting code from 2.7 to 3.2.  On the other hand, 2.7 
doesn't support keyword-only arguments at the Python level, so a keyword-only 
argument might be a bit of a surprise to users.

(2) When specifying the byteorder, is there a need to allow u'big' and 
u'little' as well as 'big' and 'little'?

--
priority: low -> high

___
Python tracker 

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



[issue6895] locale._parse_localename fails when localename does not contain encoding information

2010-02-13 Thread Santhosh Thottingal

Santhosh Thottingal  added the comment:

I see that the ml_IN added to locale.alias of X.org. 
lemburg, Do you think that my patch is still required as a fallback solution in 
case xx_YY mapping not found in locale.alias? 
If you can confirm that it is not required, we can close this bug.

--

___
Python tracker 

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



[issue5125] Strange locale problem with Python 3

2010-02-13 Thread Stefan Krah

Stefan Krah  added the comment:

As an aside, I would not use atof(). Better use something like:

char *end;

f = strtod(input, &end);
if (*end != '\0') {
PyErr_Format(PyExc_ValueError, "Could not convert: %s", end);
return NULL;
}


I've two questions:

1) Does the problem still appear in Python3.1 or Python3.2?

2) What is the output of:
>>> import locale
>>> locale.setlocale(locale.LC_ALL)

--
nosy: +skrah

___
Python tracker 

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



[issue7442] _localemodule.c: str2uni() with different LC_NUMERIC and LC_CTYPE

2010-02-13 Thread Stefan Krah

Stefan Krah  added the comment:

I have a patch that fixes this specific issue. Probably there are similar
issues in other places, e.g. when LC_TIME and LC_CTYPE differ.

I suspect that this is related:

http://bugs.python.org/issue5905

--
keywords: +patch
Added file: http://bugs.python.org/file16221/set_ctype_before_mbstowcs.patch

___
Python tracker 

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



[issue7920] urllib2.HTTPRedirectHandler incorrect redirect

2010-02-13 Thread Andres Riancho

Andres Riancho  added the comment:

The problem is still there in 2.7:

>>> urlparts = urlparse.urlparse('C:\\boot.ini')
>>> urlparts
('c', '', '\\boot.ini', '', '', '')
>>> if not urlparts.path:
... urlparts = list(urlparts)
... urlparts[2] = "/"
... 
>>> urlparts
('c', '', '\\boot.ini', '', '', '')
>>> newurl = urlparse.urlunparse(urlparts)
>>> newurl
'c:\\boot.ini'
>>> newurl = urlparse.urljoin( 'http://host.tld/spam/eggs.py', newurl)
>>> newurl
'c:\\boot.ini'
>>>

--
versions: +Python 2.7

___
Python tracker 

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



[issue7923] StreamHandler and FileHandler located in logging, not in logging.handlers

2010-02-13 Thread Kirill

New submission from Kirill :

Index: library/logging.rst
===
--- library/logging.rst (revision 78171)
+++ library/logging.rst (working copy)
@@ -1659,7 +1659,7 @@
 StreamHandler
 ^

-.. module:: logging.handlers
+.. currentmodule:: logging

 The :class:`StreamHandler` class, located in the core :mod:`logging` package,
 sends logging output to streams such as *sys.stdout*, *sys.stderr* or any
@@ -1731,6 +1731,8 @@

 .. versionadded:: 2.6

+.. currentmodule:: logging.handlers
+
 The :class:`WatchedFileHandler` class, located in the :mod:`logging.handlers`
 module, is a :class:`FileHandler` which watches the file it is logging to. If
 the file changes, it is closed and reopened using the file name.

--
assignee: georg.brandl
components: Documentation
messages: 99319
nosy: georg.brandl, x746e
severity: normal
status: open
title: StreamHandler and FileHandler located in logging, not in logging.handlers
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



[issue3475] _elementtree.c import can fail silently

2010-02-13 Thread Florent Xicluna

Changes by Florent Xicluna :


--
dependencies: +Update ElementTree with upstream changes

___
Python tracker 

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



[issue1745] Backport of PEP 3102 "keyword-only arguments" to 2.6

2010-02-13 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Mark Dickinson added the comment:
> (1) should the 'signed' parameter remain keyword-only in 2.7?

We should keep it as a keyword-only argument.  Also, issue #1745 might bring 
keyword-only arguments to 2.7.

> (2) When specifying the byteorder, is there a need to allow u'big' and
> u'little' as well as 'big' and 'little'?

Allow both. Since, 'big' == u'big' is True, it would be weird to treat them 
differently in this case.

Plus, it will make life easier for people who uses:

  from __future__ import unicode_literals

in their code.

--

___
Python tracker 

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



[issue1538691] Patch cElementTree to export CurrentLineNumber

2010-02-13 Thread Florent Xicluna

Changes by Florent Xicluna :


--
dependencies: +Update ElementTree with upstream changes
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



[issue3475] _elementtree.c import can fail silently

2010-02-13 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox
priority:  -> normal
type:  -> behavior

___
Python tracker 

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



[issue1538691] Patch cElementTree to export CurrentLineNumber

2010-02-13 Thread Florent Xicluna

Changes by Florent Xicluna :


--
nosy: +flox

___
Python tracker 

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



[issue1745] Backport of PEP 3102 "keyword-only arguments" to 2.6

2010-02-13 Thread Alexandre Vassalotti

Changes by Alexandre Vassalotti :


--

___
Python tracker 

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



[issue1023290] Conversion of longs to bytes and vice-versa.

2010-02-13 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Mark Dickinson added the comment:
> (1) should the 'signed' parameter remain keyword-only in 2.7?

We should keep it as a keyword-only argument.  Also, issue #1745 might bring 
keyword-only arguments to 2.7.

> (2) When specifying the byteorder, is there a need to allow u'big' and
> u'little' as well as 'big' and 'little'?

Allow both. Since, 'big' == u'big' is True, it would be weird to treat them 
differently in this case.

Plus, it will make life easier for people who uses:

  from __future__ import unicode_literals

in their code.

--

___
Python tracker 

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



[issue7924] test_capi crashes with misleading datetime ImportError when _curses is not built

2010-02-13 Thread Florent Xicluna

New submission from Florent Xicluna :

This crash is sporadic on some buildbots where _curses is not built:

  test_capi
  XXX undetected error
  test test_capi crashed -- : No module named datetime

Note: the changeset r76810 did not fix the issue. It can be reverted.

The problem occurs during the test "test_capsule".
To reproduce: add a typo on "_curses" on line 1666.

Links:
 
http://www.python.org/dev/buildbot/all/builders/sparc%20solaris10%20gcc%203.1/builds/237
 
http://www.python.org/dev/buildbot/all/builders/sparc%20solaris10%20gcc%203.x/builds/353

--
keywords: buildbot
messages: 99322
nosy: flox, mark.dickinson
priority: normal
severity: normal
stage: needs patch
status: open
title: test_capi crashes with misleading datetime ImportError when _curses is 
not built
type: crash
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



[issue7924] test_capi crashes with misleading datetime ImportError when _curses is not built

2010-02-13 Thread Florent Xicluna

Changes by Florent Xicluna :


--
components: +Tests

___
Python tracker 

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



[issue7925] minidom: "TypeError: writexml() takes at most 5 positional arguments (6 given)"

2010-02-13 Thread Beau

New submission from Beau :

When calling toprettyxml() from minidom.py, I get a TypeError stating that 
writexml() takes at most five positional arguments, but six are being passed.

--
components: Library (Lib)
messages: 99323
nosy: beaumartinez
severity: normal
status: open
title: minidom: "TypeError: writexml() takes at most 5 positional arguments (6 
given)"
type: compile error
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



[issue7924] test_capi crashes with misleading datetime ImportError when _curses is not built

2010-02-13 Thread Florent Xicluna

Florent Xicluna  added the comment:

The behaviour is weird.
Use attached patch to reproduce this behaviour.

 ~ $ ./python -m test.regrtest -uall test_curses test_datetime
test_curses
test_curses skipped -- No module named _NO_curses
test_datetime
1 test OK.
1 test skipped:
test_curses
Those skips are all expected on linux2.

 ~ $ ./python -m test.regrtest -uall test_capi
test_capi
test test_capi crashed -- : No module named _NO_curses
1 test failed:
test_capi

 ~ $ ./python -m test.regrtest -uall test_datetime test_capi
test_datetime
test_capi
All 2 tests OK.

 ~ $ ./python -m test.regrtest -uall test_curses test_capi
test_curses
test_curses skipped -- No module named _NO_curses
test_capi
XXX undetected error
test test_capi crashed -- : No module named datetime
1 test failed:
test_capi
1 test skipped:
test_curses
Those skips are all expected on linux2.

Now, we need to identify the culprit: Modules/_testcapimodule.c or 
Objects/capsule.c ...

--
keywords: +patch
nosy: +larry
Added file: http://bugs.python.org/file16222/issue7924_test_case.diff

___
Python tracker 

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



[issue7924] test_capi crashes with misleading datetime ImportError when _curses is not built

2010-02-13 Thread Larry Hastings

Larry Hastings  added the comment:

"To reproduce: add a typo on "_curses" on line 1666."

Of what file?

--

___
Python tracker 

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



[issue7924] test_capi crashes with misleading datetime ImportError when _curses is not built

2010-02-13 Thread Florent Xicluna

Florent Xicluna  added the comment:

The simple fix:

--- Modules/_testcapimodule.c   (revision 78171)
+++ Modules/_testcapimodule.c   (working copy)
@@ -1763,6 +1763,8 @@
Py_DECREF(object);
Py_DECREF(module);
}
+   else
+   PyErr_Clear();
}
 
   exit:

(we don't want to fail if optional "_curses" is not built)

--

___
Python tracker 

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



[issue7924] test_capi crashes with misleading datetime ImportError when _curses is not built

2010-02-13 Thread Florent Xicluna

Changes by Florent Xicluna :


--
stage: needs patch -> patch review

___
Python tracker 

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



[issue7924] test_capi crashes with misleading datetime ImportError when _curses is not built

2010-02-13 Thread Larry Hastings

Larry Hastings  added the comment:

Patch to make testcapsule clear import errors when testing.  Sorry about the 
whitespace changes, but I outdented a bunch of code--I think it's clearer this 
way.

--
Added file: http://bugs.python.org/file16223/lch.patch.trunk.py3k.r78149

___
Python tracker 

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



[issue1023290] Conversion of longs to bytes and vice-versa.

2010-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks, Alexandre!  Agreed on both points.  I don't really want to allow u'big' 
and u'little', but I think that's just my laziness talking.  (Apart from that, 
I have a working patch.)

There's some precedent for not allowing the unicode versions:

>>> float.__getformat__("double")
'IEEE, little-endian'
>>> float.__getformat__(u"double")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: __getformat__() argument must be string, not unicode

But I admit it isn't particularly compelling.

--

___
Python tracker 

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



[issue7925] minidom: "TypeError: writexml() takes at most 5 positional arguments (6 given)"

2010-02-13 Thread Florent Xicluna

Changes by Florent Xicluna :


--
priority:  -> normal
stage:  -> needs patch

___
Python tracker 

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



[issue7925] minidom: "TypeError: writexml() takes at most 5 positional arguments (6 given)"

2010-02-13 Thread Florent Xicluna

Changes by Florent Xicluna :


--
stage: needs patch -> test needed

___
Python tracker 

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



[issue7924] test_capi crashes with misleading datetime ImportError when _curses is not built

2010-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Thanks both of you for (finally) tracking this down!

I've applied flox's quick fix in r78172, and reverted the old attempted fix in 
r78173.  Both merged to py3k in r78174.

--
resolution:  -> fixed
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



[issue5125] Strange locale problem with Python 3

2010-02-13 Thread Mark Dickinson

Mark Dickinson  added the comment:

Actually, for Python 3.x, rather than using strtod directly it would be better 
to use the PyOS_string_to_double C-API function.  That function is entirely 
locale-agnostic:  it should behave identically to the float constructor.

Python 3.0 is no longer supported:  it would be good to know whether this 
problem persists with Python 3.1 or the py3k svn branch.

--
nosy: +mark.dickinson
versions: +Python 3.1, Python 3.2 -Python 3.0

___
Python tracker 

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



[issue7925] minidom: "TypeError: writexml() takes at most 5 positional arguments (6 given)"

2010-02-13 Thread Florent Xicluna

Florent Xicluna  added the comment:

Please provide some test data, and describe which behavior you expect.

--
components: +XML -Library (Lib)
nosy: +flox
resolution:  -> works for me
status: open -> pending

___
Python tracker 

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



[issue7923] StreamHandler and FileHandler located in logging, not in logging.handlers

2010-02-13 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
assignee: georg.brandl -> vinay.sajip
nosy: +vinay.sajip

___
Python tracker 

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



[issue7826] support caching for 2to3

2010-02-13 Thread Benjamin Peterson

Benjamin Peterson  added the comment:

2010/2/11 Brian Harring :
>
> Brian Harring  added the comment:
>
> @benjamin:
>
> Tests can be written; the reason this patch doesn't bundle tests up front is 
> that I wasn't going to burn the time till I knew they were needed since I 
> expected the concept to require some debate.
>
> As for the hacks angle, there isn't anything hackish there- hackish is what 
> you have to do w/out either of these patches 
> (http://www.pkgcore.org/trac/pkgcore/browser/snakeoil/snakeoil/caching_2to3.py).
>   I understand not everyone likes classes mixed on the fly, but it's a 
> perfectly valid technique w/ many, many valid uses.

While it may be a valid pattern, I still think there are more elegant solutions.

>
> Converting the innards of 2to3 over to a generalized plugin interface frankly 
> is overkill from where I'm standing- being able to plugin new fixers is one 
> thing (very useful in my opinion but orthogonal to what this ticke tis 
> about), being able to plugin on the fly different refactoring outputers is 
> another thing.

I plan to work on this this spring or summer if I have time.

>
> Personally what's in place w/in allow_alternate_output_tools.patch is more 
> than enough for the crazy ideas I've got kicking around.
>
> If you've got a specific complaint in the patch, an area that is dodgy/hacky, 
> state it please- I'm more than open to actionable criticisms.

I think delegation would be more appropriate than adding mixin classes
at runtime.

--

___
Python tracker 

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



[issue7921] Some sqlite3 Connection methods point to themselves

2010-02-13 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed in r78176 (trunk), r78177 (release26-maint), r78178 (py3k) and r78179 
(release31-maint), thanks for the report and the patch!

--
assignee: georg.brandl -> ezio.melotti
nosy: +ezio.melotti
resolution:  -> fixed
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



[issue7888] turtle "settiltangle" should be marked deprecated, not "tiltangle"

2010-02-13 Thread Ezio Melotti

Ezio Melotti  added the comment:

Fixed in r78180 (py3k) and r78181 (release31-maint), thanks for the report!

--
assignee: georg.brandl -> ezio.melotti
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



[issue7926] Stray parentheses() in context manager "what's new" doc

2010-02-13 Thread Edward Welbourne

New submission from Edward Welbourne :

http://docs.python.org/whatsnew/2.6.html#writing-context-managers
penultimate item in "A high-level explanation": 
If BLOCK raises an exception, the __exit__(type, value, traceback)() is called 
 has extra () after the argument list - this appears to say that 
__exit__ should return a callable, that shall be called with no parameters.  
Fortunately, later example code reveals that __exit__ simply returns true or 
false.

http://docs.python.org/whatsnew/2.6.html#the-contextlib-module
after the first code block: 
The contextlib module also has a nested(mgr1, mgr2, ...)() function 
 again, stray () after parameter list.
After the next short code snippet: 
Finally, the closing(object)() function returns ...


--
assignee: georg.brandl
components: Documentation
messages: 99336
nosy: eddy, georg.brandl
severity: normal
status: open
title: Stray parentheses() in context manager "what's new" doc
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



[issue6820] Redefinition of HAVE_STRFTIME can cause compiler errors.

2010-02-13 Thread Braden McDaniel

Braden McDaniel  added the comment:

In general, this does *not* play well with libraries that define the same 
symbols.

It is not correct to install the AC_CONFIG_HEADERS. Any macros in an installed 
configuration header need to be namespaced per-project; e.g., 
PYTHON_HAVE_STRFTIME.

--
nosy: +braden

___
Python tracker 

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