Comments (16)
is that on master or development?
from alot.
it also might be related to you running python 2.6: it could be that formating unicode strings has changed.
Please try the following:
#/usr/bin/python
from datetime import datetime
now = datetime.now()
print '%s (%s)' % (u'\u9896', now)
another possibility is that aname contains a utf8 string that somehow gets handed to a unicode constructor,
causing a aname.decode('ascii'), which fails..
from alot.
another possibility:
import email
email.Utils.parseaddr(u'Patrick [email protected]')
Does this return a tuple of unicode strings?
(u'Patrick', u'[email protected]')
If it does, we're ok and you don't get unicode strings from notmuch.database.Message.get_header()
which means you should pull the new (2days?) bindings from notmuch master.
from alot.
It's on master
dtk@blackboxx:/media/devel/notmuch/git/alot$ git branch
fix_docu
* master
And it happens with python 2.7 as well
dtk@blackboxx:/media/devel/notmuch/git/alot$ python2.7 bin/alot
Traceback (most recent call last):
File "bin/alot", line 20, in <module>
main()
File "/media/devel/notmuch/git/alot/alot/init.py", line 90, in main
args.colours,
File "/media/devel/notmuch/git/alot/alot/ui.py", line 74, in __init__
self.mainloop.run()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 271, in run
self.screen.run_wrapper(self._run)
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/raw_display.py", line 228, in run_wrapper
return fn()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 292, in _run
self.event_loop.run()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 667, in run
self._loop()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 705, in _loop
self._watch_files[fd]()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 343, in _update
self.process_input(keys)
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 432, in process_input
k = self._topmost_widget.keypress(self.screen_size, k)
File "/media/devel/notmuch/git/alot/alot/ui.py", line 42, in keypress
self.ui.apply_command(cmd)
File "/media/devel/notmuch/git/alot/alot/ui.py", line 349, in apply_command
cmd.apply(self)
File "/media/devel/notmuch/git/alot/alot/command.py", line 88, in apply
sb = buffer.ThreadBuffer(ui, self.thread)
File "/media/devel/notmuch/git/alot/alot/buffer.py", line 192, in __init__
self.rebuild()
File "/media/devel/notmuch/git/alot/alot/buffer.py", line 232, in rebuild
bars_at=bars)
File "/media/devel/notmuch/git/alot/alot/widgets.py", line 213, in __init__
self.sumline = self._build_sum_line()
File "/media/devel/notmuch/git/alot/alot/widgets.py", line 235, in _build_sum_line
self.sumw = MessageSummaryWidget(self.message, even=self.even)
File "/media/devel/notmuch/git/alot/alot/widgets.py", line 361, in __init__
sumstr = self.__str__()
File "/media/devel/notmuch/git/alot/alot/widgets.py", line 366, in __str__
return self.message.__str__()
File "/media/devel/notmuch/git/alot/alot/message.py", line 58, in __str__
return "%s (%s)" % (aname, self.get_datestring())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
dtk@blackboxx:/media/devel/notmuch/git/alot$
from alot.
dtk@blackboxx:~$ ipython
Python 2.6.6 (r266:84292, Sep 15 2010, 15:52:39)
Type "copyright", "credits" or "license" for more information.
IPython 0.10 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object'. ?object also works, ?? prints more.
In [1]: from datetime import datetime
In [2]: now = datetime.now()
In [3]: print '%s (%s)' % (u'\u9896', now)
颖 (2011-08-18 14:35:06.762814)
In [4]:
from alot.
how about the second suggestion?
from alot.
email.Utils.parseaddr(u'Patrick [email protected]')
Does this return a tuple of unicode strings?
well, kinda ^^
In [1]: import email
In [2]: email.Utils.parseaddr(u'Patrick [email protected]')
Out[2]: ('', u'[email protected]')
It returns a tuple of unicode strings, but the first one's empty as it doesn't seperate the name from the address ^^
Now that's nasty ^^
from alot.
$ cat email_test.py
#!/usr/bin/python2.7
import email
import platform
print platform.python_version()
print email.Utils.parseaddr(u'Patrick [email protected]')
$ python2.7 email_test.py
2.7.0+
('', u'[email protected]')
$
from alot.
haha: thats a c/p mistake with github:)
Its supposed to be
"Patrick [email protected]"
there
from alot.
In [1]: import email
In [2]: email.Utils.parseaddr(u'Patrick <[email protected]>')
Out[2]: (u'Patrick', u'[email protected]')
sweet as apple pie. will update notmuch.
from alot.
Am I missing something?
dtk@blackboxx:/media/devel/notmuch/git/notmuch$ git fetch
remote: Counting objects: 13, done.
remote: Compressing objects: 100% (7/7), done.
remote: Total 7 (delta 5), reused 0 (delta 0)
Unpacking objects: 100% (7/7), done.
From git://notmuchmail.org/git/notmuch
ee4579a..f10ec87 master -> origin/master
dtk@blackboxx:/media/devel/notmuch/git/notmuch$ git status
# On branch master
# Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
#
nothing to commit (working directory clean)
dtk@blackboxx:/media/devel/notmuch/git/notmuch$ git merge origin
Updating ee4579a..f10ec87
Fast-forward
bindings/python/notmuch/tag.py | 2 +-
bindings/python/notmuch/thread.py | 10 ++++++++--
2 files changed, 9 insertions(+), 3 deletions(-)
dtk@blackboxx:/media/devel/notmuch/git/notmuch$ cd bindings/python/
dtk@blackboxx:/media/devel/notmuch/git/notmuch/bindings/python$ sudo python2.7 setup.py install
running install
running build
running build_py
copying notmuch/thread.py -> build/lib.linux-i686-2.7/notmuch
copying notmuch/database.py -> build/lib.linux-i686-2.7/notmuch
copying notmuch/filename.py -> build/lib.linux-i686-2.7/notmuch
copying notmuch/__init__.py -> build/lib.linux-i686-2.7/notmuch
copying notmuch/globals.py -> build/lib.linux-i686-2.7/notmuch
copying notmuch/tag.py -> build/lib.linux-i686-2.7/notmuch
copying notmuch/message.py -> build/lib.linux-i686-2.7/notmuch
running install_lib
copying build/lib.linux-i686-2.7/notmuch/thread.py -> /usr/local/lib/python2.7/dist-packages/notmuch
copying build/lib.linux-i686-2.7/notmuch/tag.py -> /usr/local/lib/python2.7/dist-packages/notmuch
byte-compiling /usr/local/lib/python2.7/dist-packages/notmuch/thread.py to thread.pyc
byte-compiling /usr/local/lib/python2.7/dist-packages/notmuch/tag.py to tag.pyc
running install_egg_info
Removing /usr/local/lib/python2.7/dist-packages/notmuch-0.6.egg-info
Writing /usr/local/lib/python2.7/dist-packages/notmuch-0.6.egg-info
dtk@blackboxx:/media/devel/notmuch/git/notmuch$ cd -
/media/devel/notmuch/git/alot
dtk@blackboxx:/media/devel/notmuch/git/alot$ python2.7 bin/alot
Traceback (most recent call last):
File "bin/alot", line 20, in <module>
main()
File "/media/devel/notmuch/git/alot/alot/init.py", line 90, in main
args.colours,
File "/media/devel/notmuch/git/alot/alot/ui.py", line 74, in __init__
self.mainloop.run()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 271, in run
self.screen.run_wrapper(self._run)
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/raw_display.py", line 228, in run_wrapper
return fn()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 292, in _run
self.event_loop.run()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 667, in run
self._loop()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 705, in _loop
self._watch_files[fd]()
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 343, in _update
self.process_input(keys)
File "/usr/local/lib/python2.7/dist-packages/urwid-1.0.0-py2.7-linux-i686.egg/urwid/main_loop.py", line 432, in process_input
k = self._topmost_widget.keypress(self.screen_size, k)
File "/media/devel/notmuch/git/alot/alot/ui.py", line 42, in keypress
self.ui.apply_command(cmd)
File "/media/devel/notmuch/git/alot/alot/ui.py", line 349, in apply_command
cmd.apply(self)
File "/media/devel/notmuch/git/alot/alot/command.py", line 88, in apply
sb = buffer.ThreadBuffer(ui, self.thread)
File "/media/devel/notmuch/git/alot/alot/buffer.py", line 192, in __init__
self.rebuild()
File "/media/devel/notmuch/git/alot/alot/buffer.py", line 232, in rebuild
bars_at=bars)
File "/media/devel/notmuch/git/alot/alot/widgets.py", line 213, in __init__
self.sumline = self._build_sum_line()
File "/media/devel/notmuch/git/alot/alot/widgets.py", line 235, in _build_sum_line
self.sumw = MessageSummaryWidget(self.message, even=self.even)
File "/media/devel/notmuch/git/alot/alot/widgets.py", line 361, in __init__
sumstr = self.__str__()
File "/media/devel/notmuch/git/alot/alot/widgets.py", line 366, in __str__
return self.message.__str__()
File "/media/devel/notmuch/git/alot/alot/message.py", line 58, in __str__
return "%s (%s)" % (aname, self.get_datestring())
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
dtk@blackboxx:/media/devel/notmuch/git/alot$
from alot.
sorry, can't reproduce.. I'm usually using git pull, but fetch and merge should be the same thing.
could you fwd me the mail?
from alot.
actually, it's m4z' "Heads-up! Diplomarbeit im Anflug." thread. U received that one?
Thing is, I'm not sure whether you'll need the whole (large -.-) thread to reproduce, or which individual mail, including attachments, ...
And whether it will be reproducible after having been fwd'ed.
from alot.
I received only todays mail. anything special in the authors headers of the prev. ones?
from alot.
I used thunderbird's feature to forward a whole thread as an attachment. so... u got mail ;)
hth.
from alot.
you fixed it. somehow. somewhere. in one of the modules, I guess. I realized it worked when I set my PYTHONPATH to use the modules in the git (instead of the installed ones) in order to do some debugging. The old, installed master had the problem, develop didn't have it anymore, but I just updated master, and it seems to be working there as well now (I only got a change in USAGE, so it must have been in an earlier, not yet installed merge).
Sry for all the trouble
dtk
from alot.
Related Issues (20)
- Contact completion with khard HOT 2
- Not compatible with notmuch2 0.35 bindings HOT 15
- Act on multiple threads in search mode HOT 3
- Local hostname in Message-ID HOT 4
- Unknown values were found in config
- please make `get_body_text` more robust HOT 1
- prompt before overwriting files when saving attachments HOT 1
- ` extract_body_part` can receive empty strings and throws exceptions when it does
- Crash while trying to attach word .doc file: module 'magic' has no attribute '_libraries HOT 3
- Sort oldest first by newest email in thread HOT 1
- LookupError when displaying inbox with notmuch backend HOT 1
- Use Github Actions HOT 4
- would it be ok to convert installer to poetry ? HOT 3
- Switch from gpg to python-gnupg HOT 14
- mailcap is deprecated in Python 3.11 and will be removed in 3.13 HOT 1
- Default theme should always be readable HOT 1
- Option --all of tagging commands should apply to matched messages only HOT 7
- Startup very slow on master (due to "lazy thread lookup" fix)
- mailcap module will be removed in 3.13 HOT 2
- magic package HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from alot.