Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue15618] turtle.pencolor() chokes on unicode

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Aug 10, 2012, 9:03 AM

Post #1 of 4 (76 views)
Permalink
[issue15618] turtle.pencolor() chokes on unicode

New submission from Juancarlo Añez:

>>> t.pencolor(u'red')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<string>", line 1, in pencolor
File "/usr/lib/python2.7/lib-tk/turtle.py", line 2166, in pencolor
color = self._colorstr(args)
File "/usr/lib/python2.7/lib-tk/turtle.py", line 2600, in _colorstr
return self.screen._colorstr(args)
File "/usr/lib/python2.7/lib-tk/turtle.py", line 1111, in _colorstr
r, g, b = [round(255.0*x) for x in (r, g, b)]
TypeError: can't multiply sequence by non-int of type 'float'

----------
components: Library (Lib)
messages: 167883
nosy: apalala
priority: normal
severity: normal
status: open
title: turtle.pencolor() chokes on unicode
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15618>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 10, 2012, 9:55 AM

Post #2 of 4 (76 views)
Permalink
[issue15618] turtle.pencolor() chokes on unicode [In reply to]

Juancarlo Añez added the comment:

This patch solves the problem by making turtle check for string against basestring insted of str.

----------
keywords: +patch
Added file: http://bugs.python.org/file26758/turtle_unicode.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15618>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 10, 2012, 9:57 AM

Post #3 of 4 (73 views)
Permalink
[issue15618] turtle.pencolor() chokes on unicode [In reply to]

Juancarlo Añez added the comment:

The bug showed up in a script that used:

from __future__ import unicode_literals

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15618>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Aug 10, 2012, 11:11 AM

Post #4 of 4 (68 views)
Permalink
[issue15618] turtle.pencolor() chokes on unicode [In reply to]

Changes by Terry J. Reedy <tjreedy [at] udel>:


----------
nosy: +terry.reedy

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue15618>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.