[ python-Bugs-1748292 ] str.join() intercepts UnicodeDecodeError raised by iterator

2007-07-05 Thread SourceForge.net
Bugs item #1748292, was opened at 2007-07-05 12:10
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1748292&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Unicode
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Christoph Zwerschke (cito)
Assigned to: M.-A. Lemburg (lemburg)
Summary: str.join() intercepts UnicodeDecodeError raised by iterator

Initial Comment:
This is somewhat similar to #905389 which has already been fixed.

If you run the following two lines,

def gen(): raise UnicodeDecodeError
''.join(gen())

then instead of UnicodeDecodeError, you get:
TypeError: function takes exactly 5 arguments (0 given)

I found this bug in Python 2.3.5, 2.4.4 and 2.5.1 on Windows and Linux.

The bug appears exactly for UnicodeDecodeError,
UnicodeEncodeError, UnicodeTranslateError; all other exceptions work as 
expected. You can verify this with the following program:

import exceptions

def gen(e): raise e

for e in dir(exceptions):
e = getattr(exceptions, e)
if type(e) != type(Exception):
continue
try:
''.join(gen(e))
except BaseException, f:
e = e.__name__
f = f.__class__.__name__
if e != f:
print e, f


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1748292&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1748292 ] str.join() intercepts UnicodeDecodeError raised by iterator

2007-07-05 Thread SourceForge.net
Bugs item #1748292, was opened at 2007-07-05 12:10
Message generated for change (Comment added) made by doerwalter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1748292&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Unicode
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Christoph Zwerschke (cito)
Assigned to: M.-A. Lemburg (lemburg)
Summary: str.join() intercepts UnicodeDecodeError raised by iterator

Initial Comment:
This is somewhat similar to #905389 which has already been fixed.

If you run the following two lines,

def gen(): raise UnicodeDecodeError
''.join(gen())

then instead of UnicodeDecodeError, you get:
TypeError: function takes exactly 5 arguments (0 given)

I found this bug in Python 2.3.5, 2.4.4 and 2.5.1 on Windows and Linux.

The bug appears exactly for UnicodeDecodeError,
UnicodeEncodeError, UnicodeTranslateError; all other exceptions work as 
expected. You can verify this with the following program:

import exceptions

def gen(e): raise e

for e in dir(exceptions):
e = getattr(exceptions, e)
if type(e) != type(Exception):
continue
try:
''.join(gen(e))
except BaseException, f:
e = e.__name__
f = f.__class__.__name__
if e != f:
print e, f


--

>Comment By: Walter Dörwald (doerwalter)
Date: 2007-07-05 13:07

Message:
Logged In: YES 
user_id=89016
Originator: NO

This has nothing to do with str.join(). The following script raises the
same exception:

def gen():
   raise UnicodeDecodeError()

gen()

The problem is exactly what the exception message states: the
UnicodeDecodeError constructor expects five arguments. The following
version raises the expected UnicodeDecodeError:

def gen():
   raise UnicodeDecodeError('ascii', 'bytes', 0, 1, 'ouch')
gen()


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1748292&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1748292 ] str.join() intercepts UnicodeDecodeError raised by iterator

2007-07-05 Thread SourceForge.net
Bugs item #1748292, was opened at 2007-07-05 12:10
Message generated for change (Settings changed) made by lemburg
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1748292&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Unicode
Group: Python 2.5
>Status: Closed
>Resolution: Invalid
Priority: 5
Private: No
Submitted By: Christoph Zwerschke (cito)
Assigned to: M.-A. Lemburg (lemburg)
Summary: str.join() intercepts UnicodeDecodeError raised by iterator

Initial Comment:
This is somewhat similar to #905389 which has already been fixed.

If you run the following two lines,

def gen(): raise UnicodeDecodeError
''.join(gen())

then instead of UnicodeDecodeError, you get:
TypeError: function takes exactly 5 arguments (0 given)

I found this bug in Python 2.3.5, 2.4.4 and 2.5.1 on Windows and Linux.

The bug appears exactly for UnicodeDecodeError,
UnicodeEncodeError, UnicodeTranslateError; all other exceptions work as 
expected. You can verify this with the following program:

import exceptions

def gen(e): raise e

for e in dir(exceptions):
e = getattr(exceptions, e)
if type(e) != type(Exception):
continue
try:
''.join(gen(e))
except BaseException, f:
e = e.__name__
f = f.__class__.__name__
if e != f:
print e, f


--

Comment By: Walter Dörwald (doerwalter)
Date: 2007-07-05 13:07

Message:
Logged In: YES 
user_id=89016
Originator: NO

This has nothing to do with str.join(). The following script raises the
same exception:

def gen():
   raise UnicodeDecodeError()

gen()

The problem is exactly what the exception message states: the
UnicodeDecodeError constructor expects five arguments. The following
version raises the expected UnicodeDecodeError:

def gen():
   raise UnicodeDecodeError('ascii', 'bytes', 0, 1, 'ouch')
gen()


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1748292&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1748292 ] str.join() intercepts UnicodeDecodeError raised by iterator

2007-07-05 Thread SourceForge.net
Bugs item #1748292, was opened at 2007-07-05 12:10
Message generated for change (Comment added) made by cito
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1748292&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Unicode
Group: Python 2.5
Status: Closed
Resolution: Invalid
Priority: 5
Private: No
Submitted By: Christoph Zwerschke (cito)
Assigned to: M.-A. Lemburg (lemburg)
Summary: str.join() intercepts UnicodeDecodeError raised by iterator

Initial Comment:
This is somewhat similar to #905389 which has already been fixed.

If you run the following two lines,

def gen(): raise UnicodeDecodeError
''.join(gen())

then instead of UnicodeDecodeError, you get:
TypeError: function takes exactly 5 arguments (0 given)

I found this bug in Python 2.3.5, 2.4.4 and 2.5.1 on Windows and Linux.

The bug appears exactly for UnicodeDecodeError,
UnicodeEncodeError, UnicodeTranslateError; all other exceptions work as 
expected. You can verify this with the following program:

import exceptions

def gen(e): raise e

for e in dir(exceptions):
e = getattr(exceptions, e)
if type(e) != type(Exception):
continue
try:
''.join(gen(e))
except BaseException, f:
e = e.__name__
f = f.__class__.__name__
if e != f:
print e, f


--

>Comment By: Christoph Zwerschke (cito)
Date: 2007-07-05 15:11

Message:
Logged In: YES 
user_id=193957
Originator: YES

Thanks for the quick analysis. You're completely right, it has nothing to
do with ''.join(). You get the same error if you simply

raise UnicodeDecodeError

which I think is a bit confusing nevertheless. I had naively assumed that
you can instantiate every Exception with no or a single string argument
only, so I did not consider this could be the cause. Sorry.

--

Comment By: Walter Dörwald (doerwalter)
Date: 2007-07-05 13:07

Message:
Logged In: YES 
user_id=89016
Originator: NO

This has nothing to do with str.join(). The following script raises the
same exception:

def gen():
   raise UnicodeDecodeError()

gen()

The problem is exactly what the exception message states: the
UnicodeDecodeError constructor expects five arguments. The following
version raises the expected UnicodeDecodeError:

def gen():
   raise UnicodeDecodeError('ascii', 'bytes', 0, 1, 'ouch')
gen()


--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1748292&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[ python-Bugs-1733943 ] Tkinter is not working on trunk (2.6)

2007-07-05 Thread SourceForge.net
Bugs item #1733943, was opened at 2007-06-09 00:35
Message generated for change (Comment added) made by kbk
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1733943&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Tkinter
Group: Python 2.6
>Status: Closed
>Resolution: Fixed
>Priority: 6
Private: No
Submitted By: Hirokazu Yamamoto (ocean-city)
>Assigned to: Kurt B. Kaiser (kbk)
Summary: Tkinter is not working on trunk (2.6)

Initial Comment:
Hello. I tried to run tk app on trunk, I got following error.

///
// Code

import Tkinter as Tk
root = Tk.Tk()
label = Tk.Label(root, text="Test")
label.pack(fill=Tk.BOTH, expand=True)
root.mainloop()

///
// Error

Traceback (most recent call last):
  File "\debug.py", line 6, in 
label = Tk.Label(root, text="Test")
  File "e:\python-dev\trunk\lib\lib-tk\Tkinter.py", line 2464, in __init__
Widget.__init__(self, master, 'label', cnf, kw)
  File "e:\python-dev\trunk\lib\lib-tk\Tkinter.py", line 1930, in __init__
(widgetName, self._w) + extra + self._options(cnf))
_tkinter.TclError: invalid command name "label .12893496 -text Test"


This is due to the change revision 55504 (Stop using METH_OLDARGS)

Currently, lib/lib-tk/Tkinter.py uses this convension

1929:self.tk.call(
1930:(widgetName, self._w) + extra + self._options(cnf))

...passing argument as single tuple. METH_OLDARGS treats this as same as 

self.tk.call(
widgetName, self._w, *(extra + self._options(cnf)))

So it was working, but now METH_VARARGS, it doesn't expand single tuple as 
arguments.

Maybe do we need to check all tk.call and apply patches like this?

Index: Lib/lib-tk/Tkinter.py
===
--- Lib/lib-tk/Tkinter.py   (revision 55836)
+++ Lib/lib-tk/Tkinter.py   (working copy)
@@ -1927,7 +1927,7 @@
 classes.append((k, cnf[k]))
 del cnf[k]
 self.tk.call(
-(widgetName, self._w) + extra + self._options(cnf))
+widgetName, self._w, *(extra + self._options(cnf)))
 for k, v in classes:
 k.configure(self, v)
 def destroy(self):

# Maybe already someone working on this?


--

>Comment By: Kurt B. Kaiser (kbk)
Date: 2007-07-05 18:07

Message:
Logged In: YES 
user_id=149084
Originator: NO

Fixed at rev 56176.  Ref Patch 1496952.

Issue was arglists containing a single tuple which were unpacked
differently using the METH_OLDARG flag compared to the METH_VARARGS flag
now used.

--

Comment By: Georg Brandl (gbrandl)
Date: 2007-06-09 03:40

Message:
Logged In: YES 
user_id=849994
Originator: NO

Neal, you did that change...

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1733943&group_id=5470
___
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com