[issue7320] Unable to load external modules on build slave with debug python

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

Changes by Martin v. Löwis :


--
nosy: +loewis

___
Python tracker 

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



[issue7321] PyIter_Check(obj) fails when obj is of type PySetType

2009-11-14 Thread Damian Eads

New submission from Damian Eads :

The instructions for the C interface to the Python set class

  http://docs.python.org/c-api/set.html

say to use PyObject_GetIter and follow the iterator protocol. After
following the instructions for the iterator protocol here,

  http://docs.python.org/c-api/iter.html

I was able to successfully iterate through a set object. However,
PyIter_Check(obj) returns false yet set objects follow the iterator
protocol. Is this the correct behavior?

Thank you.

Kind regards,

Damian Eads

--
messages: 95229
nosy: damianeads
severity: normal
status: open
title: PyIter_Check(obj) fails when obj is of type PySetType
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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Trundle

Trundle  added the comment:

Crashes reliable with a segfault in Python 3.1.1.

Fixing the setter so that one can only set strings and not arbitrary 
objects is possibly the best solution.

--
nosy: +Trundle
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



[issue7296] OverflowError: signed integer is greater than maximum on mips64

2009-11-14 Thread jasper

jasper  added the comment:

Removing --with-fpectl makes no difference.

I'll try the _PyHash_Double-thing later this weekend.

--

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Eric Smith  added the comment:

I'm not sure why reason should be restricted to a string. This patch
(against trunk) just converts reason to a string when str() is called.
I'll add tests and fix the other places in exceptions.c where similar
shortcuts are taken without checking, if there's agreement on the approach.

--
assignee:  -> eric.smith
nosy: +eric.smith
priority: low -> high
stage: test needed -> patch review
type:  -> crash
versions: +Python 2.6, Python 3.2

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Eric Smith  added the comment:

Actually attach the patch.

--

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Eric Smith  added the comment:

One more time with the patch attachment.

--

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Changes by Eric Smith :


--

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Changes by Eric Smith :


--

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Eric Smith  added the comment:

For some reason I'm not able to attach the patch file. I'll look at
that, but in the meantime here's the preliminary patch against trunk:
Index: Objects/exceptions.c
===
--- Objects/exceptions.c(revision 76258)
+++ Objects/exceptions.c(working copy)
@@ -1779,7 +1779,13 @@
 UnicodeTranslateError_str(PyObject *self)
 {
 PyUnicodeErrorObject *uself = (PyUnicodeErrorObject *)self;
+PyObject *result = NULL;
+PyObject *reason_str = NULL;
 
+reason_str = PyObject_Str(uself->reason);
+if (reason_str == NULL)
+goto done;
+
 if (uself->end==uself->start+1) {
 int badchar =
(int)PyUnicode_AS_UNICODE(uself->object)[uself->start];
 char badchar_str[20];
@@ -1789,19 +1795,22 @@
 PyOS_snprintf(badchar_str, sizeof(badchar_str), "u%04x",
badchar);
 else
 PyOS_snprintf(badchar_str, sizeof(badchar_str), "U%08x",
badchar);
-return PyString_FromFormat(
+result = PyString_FromFormat(
 "can't translate character u'\\%s' in position %zd: %.400s",
 badchar_str,
 uself->start,
-PyString_AS_STRING(uself->reason)
+PyString_AS_STRING(reason_str)
 );
-}
-return PyString_FromFormat(
-"can't translate characters in position %zd-%zd: %.400s",
-uself->start,
-uself->end-1,
-PyString_AS_STRING(uself->reason)
-);
+} else
+result = PyString_FromFormat(
+"can't translate characters in position %zd-%zd: %.400s",
+uself->start,
+uself->end-1,
+PyString_AS_STRING(reason_str)
+);
+done:
+Py_XDECREF(reason_str);
+return result;
 }
 
 static PyTypeObject _PyExc_UnicodeTranslateError = {

--

___
Python tracker 

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



[issue7298] reversed(range(x, -1, -1)) is empty when x > 1

2009-11-14 Thread Mark Dickinson

Mark Dickinson  added the comment:

It looks like the PyLong version of reverse is broken too:

>>> list(range(10**100, 10**100-2, -2))
[1
]
>>> list(reversed(range(10**100, 10**100-2, -2)))
[9
998]

--

___
Python tracker 

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



[issue7315] os.path.normpath doesn't normalize ../path/something.py

2009-11-14 Thread Georg Brandl

Georg Brandl  added the comment:

If your current directory is (e.g.) /home/user, then ../xyz will not
"bring you back" to it.  (xyz/.. would.)

--

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

Note that on Py2.6, when, for example, a string is assigned to u.start
and u.end a TypeError is raised, and the value is then set to -1:
>>> u=UnicodeTranslateError(u'x', 1, 5, 'bah')
>>> u.start = 'foo'
Traceback (most recent call last):
  File "", line 1, in 
TypeError: an integer is required
>>> u.end = 'bar'
Traceback (most recent call last):
  File "", line 1, in 
TypeError: an integer is required
>>> str(u)
"can't translate characters in position -1--2: bah"
>>> u.start, u.end
(-1, -1)

Is it possible to change the values assigning an int (or even a float
that is then converted to int).

On py3k the behavior is different; as Trundle said, it segfaults easily,
and trying to change the value of u.start and u.end returns a different
error:
>>> u.start = 'foo'
Traceback (most recent call last):
  File "", line 1, in 
SystemError: Objects/longobject.c:441: bad argument to internal function


Also note that on both the versions there's no check on these values
either, it's easy to have a segfault doing this:
>>> u = UnicodeTranslateError(u'x', 1, 5, 'bah')
>>> u.start = 2**30
>>> u.end = 2**30+1
>>> str(u)

(if the char is only one, Python will try to read it and display it)

--

___
Python tracker 

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



[issue7298] reversed(range(x, -1, -1)) is empty when x > 1

2009-11-14 Thread Mark Dickinson

Mark Dickinson  added the comment:

I've updated to patch to improve the tests, and fix the problems with the 
PyLong version of range.__reversed__.  (Also updated on Rietveld.)

--
Added file: http://bugs.python.org/file15329/issue7298_v2.patch

___
Python tracker 

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



[issue7321] PyIter_Check(obj) fails when obj is of type PySetType

2009-11-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Set objects are iterable, they are not iterators themselves.
In other words, PyIter_Check() should return true when called with the
result of PyObject_GetIter() (but normally you don't need to check anyway).

--
nosy: +pitrou
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



[issue7312] Run some tests in a loop until failure

2009-11-14 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

> I've attached an updated patch that fixes the problem, but I'm not sure
> it is a correct fix.

Your patch looks fine to me.

--

___
Python tracker 

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



[issue5672] Implement a way to change the python process name

2009-11-14 Thread Domen

Changes by Domen :


--
nosy: +iElectric

___
Python tracker 

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



[issue7312] Run some tests in a loop until failure

2009-11-14 Thread R. David Murray

R. David Murray  added the comment:

Committed to trunk in r76260 and py3k in r76261.

--
resolution:  -> accepted
stage: patch review -> committed/rejected
status: open -> closed
type: behavior -> feature request

___
Python tracker 

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



[issue4683] urllib2.HTTPDigestAuthHandler fails on third hostname?

2009-11-14 Thread Senthil Kumaran

Changes by Senthil Kumaran :


--
assignee:  -> orsenthil

___
Python tracker 

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



[issue6963] Add worker process lifetime to multiprocessing.Pool - patch included

2009-11-14 Thread Charles Cazabon

Charles Cazabon  added the comment:

Hi Jesse -- Any chance you'll be able to review this in time for it to
make it into trunk for the 2.7 alpha release?

Charles

--

___
Python tracker 

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



[issue7005] ConfigParser does not handle options without values

2009-11-14 Thread Mats Kindahl

Mats Kindahl  added the comment:

So, what is the status on this?
Who needs to review it?
Is there anything I can do to get it accepted?
Do I need to make any changes (in addition to those already suggested
and done by fdrake)?

--

___
Python tracker 

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



[issue7322] Socket timeout can cause file-like readline() method to lose data

2009-11-14 Thread David M. Beazley

New submission from David M. Beazley :

Consider a socket that has had a file-like wrapper placed around it 
using makefile()

# s is a socket created previously
f = s.makefile()

Now, suppose that this socket has had a timeout placed on it.

s.settimeout(15)

If you try to read data from f, but nothing is available. You'll 
eventually get a timeout. For example:

f.readline()   # Now, just wait
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/socket.
py", line 406, in readline
data = self._sock.recv(self._rbufsize)
socket.timeout: timed out

However, now consider the case where you're reading a line of data, but 
the receiver has only received a partial line and it's waiting for the 
rest of the data to arrive.   For example, type this:

f.readline()

Now, go to the other end of the socket connection and send a buffer with 
no newline character.  For example, send the message "Hello".

Since no newline character has been received, the readline() method will 
eventually fail with a timeout as before.   However, if you now retry 
the read operation f.readline() and send more data such as the message 
"World\n", you'll find that the "Hello" message gets lost.  In other 
words, the repeated readline() operation discards any buffers 
corresponding to previously received line data and just returns the new 
data.

Admittedly this is a corner case, but you probably don't want data to be 
discarded on a TCP connection even if a timeout occurs.

Hope that makes some sense :-).  (It helps to try it out).

--
components: Library (Lib)
messages: 95245
nosy: beazley
severity: normal
status: open
title: Socket timeout can cause file-like readline() method to lose data
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



[issue4722] _winreg.QueryValue fault while reading mangled registry values

2009-11-14 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

I've noticed this depends on the user privileges. When logged in as a 
normal user, I get the internal error as originally reported. When 
logged in as an administrator, there is no error and I get an empty 
string.

--

___
Python tracker 

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



[issue6666] List of dirs to ignore in trace.py is applied only for the first file

2009-11-14 Thread Gabriel Genellina

Changes by Gabriel Genellina :


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



[issue3892] bsddb: test01_basic_replication fails sometimes

2009-11-14 Thread R. David Murray

R. David Murray  added the comment:

Failures still occur occasionally even with the timeout set to 60.  So
I've turned the check that is skipped on Windows from an assertion into
a warning only on all other platforms, since bsddb support isn't
actively maintained and is gone in py3k.  Fix applied to trunk in r76265
and 2.6 in r76267.

--
components: +Tests
stage:  -> patch review
title: bsddb: test01_basic_replication fails on Windows sometimes -> bsddb: 
test01_basic_replication fails sometimes
type:  -> behavior

___
Python tracker 

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



[issue7323] decimal.Decimal greater than/less than sometimes gives wrong answers when comparing to floats.

2009-11-14 Thread Adam Tomjack

New submission from Adam Tomjack :

These should all return False, or some of them should raise exceptions:

Python 2.6.2 (release26-maint, Apr 19 2009, 01:58:18)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import decimal
>>> decimal.Decimal('0') > 0
False
>>> decimal.Decimal('0') < 0
False
>>> decimal.Decimal('0') > 0.0
True
>>> decimal.Decimal('0') < 0.0
False
>>> 0.0 > decimal.Decimal('0')
False
>>> 0.0 < decimal.Decimal('0')
True
>>> 0.0 < decimal.Decimal('0.0')
True
>>> decimal.Decimal('0') > decimal.Decimal('0')
False

--
components: Library (Lib)
messages: 95248
nosy: adamtj
severity: normal
status: open
title: decimal.Decimal greater than/less than sometimes gives wrong answers 
when comparing to floats.
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



[issue7323] decimal.Decimal greater than/less than sometimes gives wrong answers when comparing to floats.

2009-11-14 Thread Adam Tomjack

Changes by Adam Tomjack :


--
type:  -> behavior

___
Python tracker 

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



[issue7324] Add sanity-check else case to regrtest option parsing

2009-11-14 Thread R. David Murray

New submission from R. David Murray :

In forward porting a patch to py3k I noticed that there is a 'g' option
in the optparse argument list in regrtest in 2.x that is not present in
3.x.  But the surprising thing was that there are no docs for this
option, nor any option handler in the 2.x regrtest.

I propose to add an 'else' case to the option parsing loop that asks the
user to report a bug if it is handed an unknown option.  Patch attached.

My one question is whether this might have been intentional for backward
compatibility reasons: let -g be passed and ignore it silently.  I'm
guessing it was just a deletion oversight, though.

--
components: Tests
files: regrtest-detect-bad-option.patch
keywords: patch, patch
messages: 95249
nosy: pitrou, r.david.murray
priority: low
severity: normal
stage: patch review
status: open
title: Add sanity-check else case to regrtest option parsing
type: feature request
versions: Python 2.7, Python 3.2
Added file: http://bugs.python.org/file15330/regrtest-detect-bad-option.patch

___
Python tracker 

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



[issue6963] Add worker process lifetime to multiprocessing.Pool - patch included

2009-11-14 Thread Jesse Noller

Jesse Noller  added the comment:

On Sat, Nov 14, 2009 at 11:43 AM, Charles Cazabon
 wrote:
>
> Charles Cazabon  added the comment:
>
> Hi Jesse -- Any chance you'll be able to review this in time for it to
> make it into trunk for the 2.7 alpha release?

2.7 isn't slated until next year some time, so yes.

--

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Eric Smith  added the comment:

The patch that is (hopefully) attached is a first, incomplete cut just
for demonstration purposes. I still need to cover all of the cases where
PyString_AS_STRING are called without type checking. Also, as Ezio
points out, start and end are used to index an array without type
checking. I'll fix that as well.

The patch is against trunk.

--
keywords: +patch
Added file: http://bugs.python.org/file15331/issue7309.patch

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Changes by Eric Smith :


--

___
Python tracker 

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



[issue7323] decimal.Decimal greater than/less than sometimes gives wrong answers when comparing to floats.

2009-11-14 Thread R. David Murray

Changes by R. David Murray :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

The same problem (u.start and u.end) also affects the other UnicodeError
exceptions (namely UnicodeEncodeError and UnicodeDecodeError).

Py2.4 and 2.5 don't seem to segfault with the example I provided.

--

___
Python tracker 

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



[issue4080] pyunit - display time of each test case - patch

2009-11-14 Thread Pawel Prokop

Pawel Prokop  added the comment:

Repack of unittest was good idea. It is a patch against trunk, one test
case is provided and documentation update.

--
Added file: http://bugs.python.org/file15332/unittest_runTime.patch

___
Python tracker 

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



[issue7324] Add sanity-check else case to regrtest option parsing

2009-11-14 Thread R. David Murray

R. David Murray  added the comment:

That should have been 'getopt option list'.

--

___
Python tracker 

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



[issue7324] Add sanity-check else case to regrtest option parsing

2009-11-14 Thread Brett Cannon

Brett Cannon  added the comment:

I bet it was an option oversight. Since regrtest is an internal tool we 
don't really need to fret about backwards-compatibility for anyone.

--
nosy: +brett.cannon

___
Python tracker 

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



[issue7325] tempfile.mkdtemp() does not return absolute pathname when dir is specified

2009-11-14 Thread Roy Smith

New submission from Roy Smith :

The docs (http://www.python.org/doc/2.5.1/lib/module-tempfile.html) specify 
that 
mkdtemp(), "returns the absolute pathname of the new directory".  It does that 
in 
the default case, but if you specify a relative path for 'dir', you get back a 
relative path.


$ python
Python 2.5.1 (r251:54863, Oct 17 2008, 14:39:09) 
[GCC 3.4.6 20060404 (Red Hat 3.4.6-10)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tempfile
>>> tempfile.mkdtemp(dir='.')
'./tmpHk1pBD'

similar results were obtained on:

Python 2.5.1 (r251:54863, Feb  6 2009, 19:02:12) 
[GCC 4.0.1 (Apple Inc. build 5465)] on darwin

Note that mkstemp() gets it right:

>>> tempfile.mkdtemp(dir='.')
'./tmpoPXdL7'
>>> tempfile.mkstemp(dir='.')
(3, '/Users/roy2/tmpwTGZ2y')
>>>

--
components: Library (Lib)
messages: 95256
nosy: roysmith
severity: normal
status: open
title: tempfile.mkdtemp() does not return absolute pathname when dir is 
specified
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



[issue7322] Socket timeout can cause file-like readline() method to lose data

2009-11-14 Thread Gregory P. Smith

Changes by Gregory P. Smith :


--
assignee:  -> gregory.p.smith
nosy: +gregory.p.smith
priority:  -> normal

___
Python tracker 

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



[issue7325] tempfile.mkdtemp() does not return absolute pathname when dir is specified

2009-11-14 Thread R. David Murray

R. David Murray  added the comment:

This is true on trunk and py3k as well.  2.5 is in security fix only
mode, so I've removed it from the versions list.

Since mkstemp does return in the absolute path in this case, I think
this is a code rather than a documentation bug.  However, changing it
would be backward incompatible, so it may not be possible to fix it in
2.6 and 3.1.

--
keywords: +easy
nosy: +r.david.murray
priority:  -> normal
stage:  -> test needed
versions: +Python 2.6, Python 2.7, Python 3.1, Python 3.2 -Python 2.5

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

2009-11-14 Thread Alexandre Vassalotti

Alexandre Vassalotti  added the comment:

Here's an updated patch.

- Renamed tobytes() to to_bytes() and frombytes() to from_bytes().
- Moved the changes to pickle to a different patch.
- Made the NULL-checks more consistent with the rest of long's code.
- Fixed the type check of the `length' parameter of to_bytes() to use
  PyIndex_Check() instead of PyLong_Check().

--
dependencies: +Move the special-case for integer objects out of 
PyBytes_FromObject.
Added file: http://bugs.python.org/file15333/long_and_bytes_conversion-3.diff

___
Python tracker 

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



[issue6804] IDLE: Detect Python files even if name doesn't end in .py

2009-11-14 Thread Gabriel Genellina

Changes by Gabriel Genellina :


Removed file: http://bugs.python.org/file14803/EditorWindow.diff

___
Python tracker 

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



[issue6804] IDLE: Detect Python files even if name doesn't end in .py

2009-11-14 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

This new patch addresses the previous comments.

--
Added file: http://bugs.python.org/file15334/EditorWindow.diff

___
Python tracker 

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



[issue6906] Tkinter sets an unicode environment variable on win32

2009-11-14 Thread Gabriel Genellina

Gabriel Genellina  added the comment:

This patch may solve this issue, but I don't have a Vista install to 
test it.

--
keywords: +patch
Added file: http://bugs.python.org/file15335/FixTk.diff

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Eric Smith  added the comment:

Another patch against trunk which deals with:

UnicodeEncodeError: reason and encoding
UnicodeDecodeError: reason and encoding
UnicodeTranslateError: reason

Still needs tests. Also, the unchecked use of start and end needs to be
addressed. I'm working on that.

--
Added file: http://bugs.python.org/file15336/issue7309.patch

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Changes by Eric Smith :


Removed file: http://bugs.python.org/file15331/issue7309.patch

___
Python tracker 

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



[issue7323] decimal.Decimal greater than/less than sometimes gives wrong answers when comparing to floats.

2009-11-14 Thread Mark Dickinson

Mark Dickinson  added the comment:

Unfortunately there's no easy way to fix this in 2.x, where any object is 
supposed to be comparable with any other.  See issue 2531 for a previous 
discussion.  It's fixed in 3.x:  there a comparison (other than ==, !=) 
between a float and a Decimal does raise an exception.

Closing as a duplicate of issue 2531.  Issue 2531 is also closed, but you 
should feel free to add to the discussion there.

--
resolution:  -> duplicate
status: open -> closed
superseder:  -> float compared to decimal is silently incorrect.

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Changes by Eric Smith :


Added file: http://bugs.python.org/file15337/issue7309-1.patch

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Changes by Eric Smith :


Removed file: http://bugs.python.org/file15336/issue7309.patch

___
Python tracker 

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



[issue2531] float compared to decimal is silently incorrect.

2009-11-14 Thread Mark Dickinson

Mark Dickinson  added the comment:

Just closed issue 7323 as a duplicate of this one.

I think this issue is worth reopening:  with the backport of the py3k 
correctly rounded string <-> float conversions, there might now be a 
reasonable way to rewrite Decimal.__hash__ so that it's consistent with 
float.__hash__.  Then we can make Decimal-to-float comparisons behave 
correctly and clear up this mess.

I'd still be uncomfortable with allowing Decimal-to-float comparisons in 
2.x but not in 3.x.  Maybe they could be permitted in 3.x too?

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

___
Python tracker 

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



[issue2531] float compared to decimal is silently incorrect.

2009-11-14 Thread Mark Dickinson

Changes by Mark Dickinson :


--
nosy: +adamtj

___
Python tracker 

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



[issue7323] decimal.Decimal greater than/less than sometimes gives wrong answers when comparing to floats.

2009-11-14 Thread Mark Dickinson

Mark Dickinson  added the comment:

I've re-opened issue 2531:  some recent changes (in particular, the 
backport of the 3.x float <-> string conversions to 2.x) may make 
previously rejected solutions viable again.

--

___
Python tracker 

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



[issue7309] crasher in str(Exception())

2009-11-14 Thread Eric Smith

Eric Smith  added the comment:

Tests need to cover issues like:

# assigning a non-string to e.object
e = UnicodeDecodeError("", "", 0, 1, "")
e.object = None
print str(e)

# start and end out of range
e = UnicodeDecodeError("", "", 0, 1, "")
e.start = 1000
e.end = 1001
print str(e)

For all cases of UnicodeXXXError with start and end, the code has a
special case for end = start+1. Invalid start/end tests need to have
end==start+1, end>start+1, end

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



[issue4049] IDLE does not open too

2009-11-14 Thread Patricia Irwin

Patricia Irwin  added the comment:

Hi, 

I'm running Windows XP Professional and just installed Python 2.6. I
installed it for all users. Tried starting up IDLE and nothing happened.
I read the boards here, and it looks like others have had similar
troubles. I read on this board that moving the Tcl/Tk directories
helped, so I tried moving the tcl8.5 and tk8.5 directories to
C:\Python26\Lib, but IDLE still wouldn't start up. (So I moved them back.)

I opened a command shell and tried running idle that way. I will paste
the output below. Could someone help with this? Sorry if this is the
wrong place to post this problem; I am Python newbie.

C:\Python26>python Lib\idlelib\idle.py

Traceback (most recent call last):
  File "Lib\idlelib\idle.py", line 21, in 
idlelib.PyShell.main()
  File "C:\Python26\lib\idlelib\PyShell.py", line 1400, in main
shell = flist.open_shell()
  File "C:\Python26\lib\idlelib\PyShell.py", line 279, in open_shell
self.pyshell = PyShell(self)
  File "C:\Python26\lib\idlelib\PyShell.py", line 820, in __init__
OutputWindow.__init__(self, flist, None, None)
  File "C:\Python26\lib\idlelib\OutputWindow.py", line 16, in __init__
EditorWindow.__init__(self, *args)
  File "C:\Python26\lib\idlelib\EditorWindow.py", line 234, in __init__
self.update_recent_files_list()
  File "C:\Python26\lib\idlelib\EditorWindow.py", line 755, in
update_recent_fil
es_list
rf_file = open(self.recent_files_path, 'w')
IOError: [Errno 13] Permission denied: 'C:\\Documents and
Settings\\Tricia\\.idl
erc\\recent-files.lst'

--
nosy: +pi
versions: +Python 2.6 -Python 3.0

___
Python tracker 

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



[issue7324] Add sanity-check else case to regrtest option parsing

2009-11-14 Thread R. David Murray

R. David Murray  added the comment:

Committed in r76276 through r76281, along with removing 'g' from the
getopt list in 2.6.  3.1 still has other traces of the -g option; I
haven't cleaned that up.

--
assignee:  -> r.david.murray
resolution:  -> fixed
stage: patch review -> committed/rejected
status: open -> closed
type: feature request -> behavior

___
Python tracker 

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



[issue7293] test_msvc9compiler test_reg_class failure on new Windows box

2009-11-14 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

> Does it have to be a DWORD, or a 0/1 value, or under HKCU for a
> specific reason?

This notepad test was just to make sure the registry reader works
by returning a known value.

I can change it using:

Reg.get_value("Software\Microsoft\VisualStudio\9.0\VC", "Build Timing")
 == 0


For this test, if you can check that this value is the same on a fresh
win XP and 7, it's perfect. (8.0 doesn't matter here, I can restrict the
build version to 9.0)

--

___
Python tracker 

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



[issue4359] at runtime, distutils uses buildtime files

2009-11-14 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

This is a problem indeed. 

One solution would be to generate a module in the stdlib that contains
all these info, when configure is called.

as a matter of fact, I am currently working in a branch to add a module
called "sysconfig" to the stdlib, that contains installation paths
extracted from distutils/sysconfig and site.py, so the stdlib has only
one place to handle those.

This module will basically be the last spot to look for data in makefile
and pyconfig.h, so maybe we could inject in it a condensed version of
these files, in the form of a dict.

(I'll send a mail on python-dev about this)

--

___
Python tracker 

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



[issue4049] IDLE does not open too

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

Martin v. Löwis  added the comment:

Patricia, if you want to report a bug, please don't follow up to an
existing, closed bug report.

If you are just asking for help: delete the folder .idlerc and all of
its files, and retry.

--

___
Python tracker 

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



[issue4359] at runtime, distutils uses buildtime files

2009-11-14 Thread Tarek Ziadé

Tarek Ziadé  added the comment:

see http://mail.python.org/pipermail/python-dev/2009-November/094232.html

(notice that the dependency in install can be removed easily because it
just reads variables from sys and does not require to import sysconfig)

--

___
Python tracker 

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



[issue6906] Tkinter sets an unicode environment variable on win32

2009-11-14 Thread Michał Pasternak

Michał Pasternak  added the comment:

This patch works OK for me (Vista Home Premium + Python 2.6), thanks!

--

___
Python tracker 

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



[issue7326] SOLUTION pls? /usr/lib/python2.6/dist-packages/visual/__init__.py", line 59, in import cvisual AttributeError: 'Boost.Python.StaticProperty' object attribute '__doc__' is read-onl

2009-11-14 Thread pablo veloz

New submission from pablo veloz :

sorry for my english, but how can i reparer that problem? help me pls thank.

--
messages: 95273
nosy: pveloz
severity: normal
status: open
title: SOLUTION pls? /usr/lib/python2.6/dist-packages/visual/__init__.py", line 
59, in  import cvisual AttributeError: 
'Boost.Python.StaticProperty' object attribute '__doc__' is read-only
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



[issue1368312] fix for scheme identification in urllib2?

2009-11-14 Thread Senthil Kumaran

Senthil Kumaran  added the comment:

This issue is Invalid. I am sorry that it had be open for so long
without any explanation. 

The order in which the handlers are tried does not depend upon the way
http_error_auth_reqed method is coded, but rather on the handler_order.
In urllib2, we have handler_order set to 490 for digest and 500 for
basic, which means that Digest will always be tried before Basic
(Correctly so).  If you have any server implementing both Basic and
Digest (well,it is bad idea on the server part), you can try with any
client, like firefox and see that Digest overrules Basic.

Now, if you have two files (one under Basic Authentication ) and another
under Digest Authentication configured, then it all boils down to adding
"both" HTTPBasicAuthHandler and HTTPDigestAuthHandler to your
OpenerDirector instance. The handler_order and opener instance will
properly take care of opening the individual distinct requests with
appropriate handlers.
I tested it with the setup here and could not see any problem.  I am
closing this bug as Invalid.

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



[issue6816] Provide CPython command line functionality via runpy module

2009-11-14 Thread Nick Coghlan

Nick Coghlan  added the comment:

Descoped idea to just provide runpy.run_path (filesystem path equivalent
of runpy.run_module)

--

___
Python tracker 

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