<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Mateusz,<br>
<br>
Unfortunately that error message hides where the error actually
occurred because it can't form the error message.<br>
But presumably you've put in print statements to sys.stderr and
have bracketed the exact location where the problem happens.<br>
<br>
Once you identify the exact location, the UnicodeDecodeError
indicates that you were using a string instead of a unicode
string. If your string only contains ASCII characters, that is
fine. If not, it needs to have a UTF-8 encoding, or you need to
use a unicode string. ( See <a
href="http://docs.python.org/2/howto/unicode.html">http://docs.python.org/2/howto/unicode.html</a>
for details about unicode strings in Python 2.)<br>
<br>
For example, if your string has a Polish encoding, a.k.a. ISO/IEC
8859-2, then to get the unicode equivalent:<br>
<br>
unicode_string = string.decode('iso 8859-2')<br>
<a href="http://docs.python.org/2/howto/unicode.html"><br>
</a>How you know what encoding to use depends on how the string
was obtained. Since the character that couldn't be decoded in the
error message corresponds to a letter in your name, you might be
able to fix this bug by adding the proper encoding comment at the
top of your .py file and using a unicode string constant whenever
that character is used in a string.<br>
<br>
To fix the error reporting (this change will be in the next 1.8
release candidate and the daily build), I'm adding the following
two lines to .../lib/site-packages/Pmw/Pmw_1_3/lib/PmwBase.py:<br>
<br>
if not isinstance(exc_value, unicode):<br>
exc_value = exc_value.decode('utf-8', 'replace')<br>
<br>
Just before the line:<br>
<br>
msg = msg + u'%s: %s\n' % (exc_type, exc_value)<br>
<br>
as seen in the traceback in your screen shot. FYI, on Windows, to
get the text of the debug window instead of doing a screen shot,
you right-click on the title bar and use the Edit submenu to
Select All and Copy the text.<br>
<br>
HTH,<br>
<br>
Greg<br>
<br>
On 05/23/2013 09:44 AM, Mateusz Dobrychłop wrote:<br>
</div>
<blockquote
cite="mid:CAMJBqiyhHmQyoJBQS4PTwEds4Ao7dN6_=59urRDW==_hVzoK+w@mail.gmail.com"
type="cite">
<div dir="ltr">Hello,
<div><br>
</div>
<div style="">I'm writing a Chimera extension that uses modules
that it imports an external module.</div>
<div style=""><br>
</div>
<div style="">To do this, I append the sys.path with a path to
the directory where the module is placed and then I just
import it. And then Chimera crashes.</div>
<div style=""><br>
</div>
<div style="">The line with the import is the one that directly
causes the crash.</div>
<div style=""><br>
</div>
<div style="">I'm attaching a screenshot of the error that
Chimera throws when I run it with --debug option. I have no
idea what might be wrong.</div>
<div style=""><br>
</div>
<div style="">Thank you for your time,</div>
<div style="">Mateusz</div>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Chimera-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Chimera-dev@cgl.ucsf.edu">Chimera-dev@cgl.ucsf.edu</a>
<a class="moz-txt-link-freetext" href="http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev">http://www.rbvi.ucsf.edu/mailman/listinfo/chimera-dev</a>
</pre>
</blockquote>
<br>
</body>
</html>