Turn Turnsole into a generic mail client
Hi Vivien, Reformatted excerpts from Vivien Didelot's message of 2011-06-19: > As Turnsole is a great mail interface, I was thinking about having it > generic to multiple servers or mail sources, to fit many use cases. > > Explicitely, the Turnsole::Client class ( > https://github.com/wmorgan/turnsole/blob/master/lib/turnsole/client.rb) > could be turned into a Turnsole::Client module instead, The server portion of turnsole, heliotrope, is explicitly designed to support multiple clients and provides a JSON-over-HTTP interface for that purpose. The specifics of the protocol are still subject to change, but see e.g. https://github.com/wmorgan/heliotrope/blob/master/lib/heliotrope-client.rb for the ruby client that turnsole uses to communicate with the server. -- William
[python] segfaults at Message.get_date
On Sun, Jun 19, 2011 at 5:45 AM, Dmitry Kurochkin wrote: > Hi Sebastian, Patrick. > > On Sat, 18 Jun 2011 12:30:01 +0200, Sebastian Spaeth SSpaeth.de> wrote: >> On Fri, 17 Jun 2011 17:10:24 +0100, Patrick Totzke : >> > #0 ?0x006eb87d in Xapian::Document::Internal::get_value(unsigned int) >> > const () from /usr/lib/sse2/libxapian.so.22 >> > #1 ?0x006eb952 in Xapian::Document::get_value(unsigned int) const () from >> > /usr/lib/sse2/libxapian.so.22 >> > #2 ?0x00523963 in notmuch_message_get_date () from >> > /usr/local/lib/libnotmuch.so.1 >> >> One question, what type is libnotmuch really returning here? The code: >> >> >> time_t >> notmuch_message_get_date (notmuch_message_t *message) >> { ? ... >> ? ? return Xapian::sortable_unserialise (value); >> } >> >> But Xapian API says that sortable_unserialise() returns floating type >> "double" >> >> http://xapian.org/docs/apidoc/html/namespaceXapian.html#326fe2d6b0ee59ac9536f3960e8fd99b >> "Convert a string encoded using sortable_serialise back to a floating >> point number." >> >> But time_t is usually a (signed) long and not floating point. Obviously >> things have worked just fine so far, but is libnotmuch really returning >> the right type here? Sorry, I expose my total lack of basic C++ knowledge >> here... >> > > Converting double to time_t does not look good. ?Notmuch converts > between time_t and double both when setting and getting the date. ?I > guess it should work good in most cases at least. ?Perhaps Carl knows > better that it is safe. A double will precisely represent integers up to 2^53, so this conversion shouldn't be a problem until the year 285422109 or so.
[python] segfaults at Message.get_date
On Sun, 19 Jun 2011 13:45:07 +0400, Dmitry Kurochkin wrote: > Sebastian, are you able to reproduce the issue? A python script that > triggers the bug, perhaps? I would look at this if I can reproduce the > problem. No, not reproducable at all. I only had it twice actually. Patrick had it several times but he can't reliably reproduce either. Sebastian -- next part -- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: not available URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20110619/d0557421/attachment.pgp>
[PATCH 2/2] Do not import notmuch in setup.py.
From: David BremnerImporting notmuch loads the notmuch shared library. When building without a system install of notmuch, this requires e.g. setting LD_LIBRARY_PATH for building and fails completely for cleaning. --- bindings/python/setup.py | 17 - 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index e4a3a25..1497bc4 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -1,7 +1,22 @@ #!/usr/bin/env python +import os +import re from distutils.core import setup -from notmuch import __VERSION__ + +def get_version(): +file = open('notmuch/__init__.py') +try: +for line in file: +if re.match('__VERSION__\s*=\s*',line) != None: +version = line.split('=', 1)[1] +return eval(version, {}, {}) +finally: +file.close() +raise IOError('Unexpected end-of-file') + +__VERSION__=get_version() + setup(name='notmuch', version=__VERSION__, description='Python binding of the notmuch mail search and indexing library.', -- 1.7.5.3
[PATCH 1/2] Build debian package for python-bindings.
From: David BremnerThis uses dh_python2 (included with sufficiently recent versions of the python/python-all packages). python-all brings in all of the supported versions of python. The double calls to dh_auto_install are to avoid looping over python versions ourselves. --- debian/control| 17 - debian/python-notmuch.install |1 + debian/rules | 14 +- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 debian/python-notmuch.install diff --git a/debian/control b/debian/control index 3491e9a..fa5f762 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,9 @@ Section: mail Priority: extra Maintainer: Carl Worth Uploaders: Jameson Graef Rollins , martin f. krafft -Build-Depends: debhelper (>= 7.0.50~), pkg-config, libxapian-dev, libgmime-2.4-dev, libtalloc-dev, libz-dev, emacs (>= 23~) +Build-Depends: debhelper (>= 7.0.50~), pkg-config, libxapian-dev, + libgmime-2.4-dev, libtalloc-dev, libz-dev, emacs (>= 23~), + python-all (>= 2.6.6-3~) Standards-Version: 3.9.1.0 Homepage: http://notmuchmail.org/ Vcs-Git: git://notmuchmail.org/git/notmuch @@ -49,3 +51,16 @@ Description: thread-based email index, search and tagging (development) . This package provides the necessary development libraries and header files to allow you to develop new software using libnotmuch. + +Package: python-notmuch +Architecture: all +Section: python +Depends: ${misc:Depends}, ${python:Depends}, libnotmuch1 +Description: python interface to the notmuch mail search and index library + Notmuch is a system for indexing, searching, reading, and tagging + large collections of email messages in maildir or mh format. It uses + the Xapian library to provide fast, full-text search with a very + convenient search syntax. + . + This package provides a Python interface to the notmuch + functionality, directly interfacing with a shared notmuch library. diff --git a/debian/python-notmuch.install b/debian/python-notmuch.install new file mode 100644 index 000..607c065 --- /dev/null +++ b/debian/python-notmuch.install @@ -0,0 +1 @@ +usr/lib/python* diff --git a/debian/rules b/debian/rules index a4b526c..7343ac2 100755 --- a/debian/rules +++ b/debian/rules @@ -1,11 +1,23 @@ #!/usr/bin/make -f %: - dh $@ + dh --with python2 $@ override_dh_auto_configure: dh_auto_configure -- --emacslispdir=/usr/share/emacs/site-lisp/notmuch +override_dh_auto_build: + dh_auto_build + dh_auto_build --sourcedirectory bindings/python + +override_dh_auto_clean: + dh_auto_clean + dh_auto_clean --sourcedirectory bindings/python + +override_dh_auto_install: + dh_auto_install + dh_auto_install --sourcedirectory bindings/python + override_dh_installdocs: dh_installdocs install -m644 vim/README debian/notmuch/usr/share/doc/notmuch/README.vim -- 1.7.5.3
No subject
Bah, my previous attempt didn't build cleanly in a chroot, so I had to patch setup.py.
Turn Turnsole into a generic mail client
Hi William and others, As Turnsole is a great mail interface, I was thinking about having it generic to multiple servers or mail sources, to fit many use cases. Explicitely, the Turnsole::Client class ( https://github.com/wmorgan/turnsole/blob/master/lib/turnsole/client.rb) could be turned into a Turnsole::Client module instead, which implements the necessary abstract methods for the interface, and which needs to be included in every client adapters (like DataMapper adapters are working for instance). Built-in Turnsole adapters would be in lib/turnsole/client/. That way, we could easily implement Turnsole adapters for many sources, such as: Heliotrope (for sure, the official adapter), IMAP (direct connection), Gmail (simpler adapter using the IMAP adapter), Maildir/Mbox, NotMuchMail (which is a great Sup-like email back-end), upasfs, etc. The main reason why I'm posting that, is that I really like the Turnsole ncurses based interface, but sometimes I'd like to check emails directly from imap (when not on my computer for instance). I also know that NotMuch is missing a good ncurses-based client (that's why I've Cc'd them). What do you think? Is there limitations I didn't think about? -- Vivien Didelot, vivien.didelot.org -- next part -- An HTML attachment was scrubbed... URL: <http://notmuchmail.org/pipermail/notmuch/attachments/20110619/4c41b27c/attachment.html>
[PATCH] Build debian package for python-bindings.
From: David BremnerThis uses dh_python2 (included with sufficiently recent versions of the python/python-all packages). python-all brings in all of the supported versions of python. The double calls to dh_auto_install are to avoid looping over python versions ourselves. --- debian/control | 17 - debian/rules | 14 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 3491e9a..2fefcbe 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,9 @@ Section: mail Priority: extra Maintainer: Carl Worth Uploaders: Jameson Graef Rollins , martin f. krafft -Build-Depends: debhelper (>= 7.0.50~), pkg-config, libxapian-dev, libgmime-2.4-dev, libtalloc-dev, libz-dev, emacs (>= 23~) +Build-Depends: debhelper (>= 7.0.50~), pkg-config, libxapian-dev, + libgmime-2.4-dev, libtalloc-dev, libz-dev, emacs (>= 23~), + python-all (>= 2.6.6-3~) Standards-Version: 3.9.1.0 Homepage: http://notmuchmail.org/ Vcs-Git: git://notmuchmail.org/git/notmuch @@ -49,3 +51,16 @@ Description: thread-based email index, search and tagging (development) . This package provides the necessary development libraries and header files to allow you to develop new software using libnotmuch. + +Package: python-notmuch +Architecture: all +Section: python +Depends: ${misc:Depends},${python:Depends}, libnotmuch1 +Description: python interface to the notmuch mail search and index library + Notmuch is a system for indexing, searching, reading, and tagging + large collections of email messages in maildir or mh format. It uses + the Xapian library to provide fast, full-text search with a very + convenient search syntax. + . + This package provides a python interface to the notmuch + functionality, directly interfacing with a shared notmuch library. diff --git a/debian/rules b/debian/rules index a4b526c..5aa27e8 100755 --- a/debian/rules +++ b/debian/rules @@ -1,11 +1,23 @@ #!/usr/bin/make -f %: - dh $@ + dh --with python2 $@ override_dh_auto_configure: dh_auto_configure -- --emacslispdir=/usr/share/emacs/site-lisp/notmuch +override_dh_auto_build: + dh_auto_build + dh_auto_build --sourcedirectory bindings/python + +override_dh_auto_install: + dh_auto_install + dh_auto_install --sourcedirectory bindings/python + +override_dh_auto_clean: + dh_auto_clean + dh_auto_clean --sourcedirectory bindings/python + override_dh_installdocs: dh_installdocs install -m644 vim/README debian/notmuch/usr/share/doc/notmuch/README.vim -- 1.7.5.3
[python] segfaults at Message.get_date
Hi Sebastian, Patrick. On Sat, 18 Jun 2011 12:30:01 +0200, Sebastian Spaeth wrote: > On Fri, 17 Jun 2011 17:10:24 +0100, Patrick Totzke : > > #0 0x006eb87d in Xapian::Document::Internal::get_value(unsigned int) const > > () from /usr/lib/sse2/libxapian.so.22 > > #1 0x006eb952 in Xapian::Document::get_value(unsigned int) const () from > > /usr/lib/sse2/libxapian.so.22 > > #2 0x00523963 in notmuch_message_get_date () from > > /usr/local/lib/libnotmuch.so.1 > > One question, what type is libnotmuch really returning here? The code: > > > time_t > notmuch_message_get_date (notmuch_message_t *message) > { ... > return Xapian::sortable_unserialise (value); > } > > But Xapian API says that sortable_unserialise() returns floating type "double" > > http://xapian.org/docs/apidoc/html/namespaceXapian.html#326fe2d6b0ee59ac9536f3960e8fd99b > "Convert a string encoded using sortable_serialise back to a floating > point number." > > But time_t is usually a (signed) long and not floating point. Obviously > things have worked just fine so far, but is libnotmuch really returning > the right type here? Sorry, I expose my total lack of basic C++ knowledge > here... > Converting double to time_t does not look good. Notmuch converts between time_t and double both when setting and getting the date. I guess it should work good in most cases at least. Perhaps Carl knows better that it is safe. This is not relevant to the segfault. The failure happens in: value = message->doc.get_value (NOTMUCH_VALUE_TIMESTAMP); before conversion from double to time_t. Sebastian, are you able to reproduce the issue? A python script that triggers the bug, perhaps? I would look at this if I can reproduce the problem. Patrick, can you install debugging symbols for libxapian and get the backtrace again? On Debian you need to install libxapian22-dbg. Regards, Dmitry > Sebastian > ___ > notmuch mailing list > notmuch at notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH] debian: break up build-depends on separate lines
For clarity and cleaner future diffs. --- debian/control | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index fa5f762..8ffa22b 100644 --- a/debian/control +++ b/debian/control @@ -3,9 +3,15 @@ Section: mail Priority: extra Maintainer: Carl Worth Uploaders: Jameson Graef Rollins , martin f. krafft -Build-Depends: debhelper (>= 7.0.50~), pkg-config, libxapian-dev, - libgmime-2.4-dev, libtalloc-dev, libz-dev, emacs (>= 23~), - python-all (>= 2.6.6-3~) +Build-Depends: + debhelper (>= 7.0.50~), + pkg-config, + libxapian-dev, + libgmime-2.4-dev, + libtalloc-dev, + libz-dev, + emacs (>= 23~), + python-all (>= 2.6.6-3~), Standards-Version: 3.9.1.0 Homepage: http://notmuchmail.org/ Vcs-Git: git://notmuchmail.org/git/notmuch -- 1.7.5.3
Re: [python] segfaults at Message.get_date
Hi Sebastian, Patrick. On Sat, 18 Jun 2011 12:30:01 +0200, Sebastian Spaeth sebast...@sspaeth.de wrote: On Fri, 17 Jun 2011 17:10:24 +0100, Patrick Totzke : #0 0x006eb87d in Xapian::Document::Internal::get_value(unsigned int) const () from /usr/lib/sse2/libxapian.so.22 #1 0x006eb952 in Xapian::Document::get_value(unsigned int) const () from /usr/lib/sse2/libxapian.so.22 #2 0x00523963 in notmuch_message_get_date () from /usr/local/lib/libnotmuch.so.1 One question, what type is libnotmuch really returning here? The code: time_t notmuch_message_get_date (notmuch_message_t *message) { ... return Xapian::sortable_unserialise (value); } But Xapian API says that sortable_unserialise() returns floating type double http://xapian.org/docs/apidoc/html/namespaceXapian.html#326fe2d6b0ee59ac9536f3960e8fd99b Convert a string encoded using sortable_serialise back to a floating point number. But time_t is usually a (signed) long and not floating point. Obviously things have worked just fine so far, but is libnotmuch really returning the right type here? Sorry, I expose my total lack of basic C++ knowledge here... Converting double to time_t does not look good. Notmuch converts between time_t and double both when setting and getting the date. I guess it should work good in most cases at least. Perhaps Carl knows better that it is safe. This is not relevant to the segfault. The failure happens in: value = message-doc.get_value (NOTMUCH_VALUE_TIMESTAMP); before conversion from double to time_t. Sebastian, are you able to reproduce the issue? A python script that triggers the bug, perhaps? I would look at this if I can reproduce the problem. Patrick, can you install debugging symbols for libxapian and get the backtrace again? On Debian you need to install libxapian22-dbg. Regards, Dmitry Sebastian ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [python] segfaults at Message.get_date
On Sun, 19 Jun 2011 13:45:07 +0400, Dmitry Kurochkin wrote: Sebastian, are you able to reproduce the issue? A python script that triggers the bug, perhaps? I would look at this if I can reproduce the problem. No, not reproducable at all. I only had it twice actually. Patrick had it several times but he can't reliably reproduce either. Sebastian pgpUsGMNIiDnx.pgp Description: PGP signature ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH] Build debian package for python-bindings.
From: David Bremner brem...@debian.org This uses dh_python2 (included with sufficiently recent versions of the python/python-all packages). python-all brings in all of the supported versions of python. The double calls to dh_auto_install are to avoid looping over python versions ourselves. --- debian/control | 17 - debian/rules | 14 +- 2 files changed, 29 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index 3491e9a..2fefcbe 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,9 @@ Section: mail Priority: extra Maintainer: Carl Worth cwo...@debian.org Uploaders: Jameson Graef Rollins jroll...@finestructure.net, martin f. krafft madd...@debian.org -Build-Depends: debhelper (= 7.0.50~), pkg-config, libxapian-dev, libgmime-2.4-dev, libtalloc-dev, libz-dev, emacs (= 23~) +Build-Depends: debhelper (= 7.0.50~), pkg-config, libxapian-dev, + libgmime-2.4-dev, libtalloc-dev, libz-dev, emacs (= 23~), + python-all (= 2.6.6-3~) Standards-Version: 3.9.1.0 Homepage: http://notmuchmail.org/ Vcs-Git: git://notmuchmail.org/git/notmuch @@ -49,3 +51,16 @@ Description: thread-based email index, search and tagging (development) . This package provides the necessary development libraries and header files to allow you to develop new software using libnotmuch. + +Package: python-notmuch +Architecture: all +Section: python +Depends: ${misc:Depends},${python:Depends}, libnotmuch1 +Description: python interface to the notmuch mail search and index library + Notmuch is a system for indexing, searching, reading, and tagging + large collections of email messages in maildir or mh format. It uses + the Xapian library to provide fast, full-text search with a very + convenient search syntax. + . + This package provides a python interface to the notmuch + functionality, directly interfacing with a shared notmuch library. diff --git a/debian/rules b/debian/rules index a4b526c..5aa27e8 100755 --- a/debian/rules +++ b/debian/rules @@ -1,11 +1,23 @@ #!/usr/bin/make -f %: - dh $@ + dh --with python2 $@ override_dh_auto_configure: dh_auto_configure -- --emacslispdir=/usr/share/emacs/site-lisp/notmuch +override_dh_auto_build: + dh_auto_build + dh_auto_build --sourcedirectory bindings/python + +override_dh_auto_install: + dh_auto_install + dh_auto_install --sourcedirectory bindings/python + +override_dh_auto_clean: + dh_auto_clean + dh_auto_clean --sourcedirectory bindings/python + override_dh_installdocs: dh_installdocs install -m644 vim/README debian/notmuch/usr/share/doc/notmuch/README.vim -- 1.7.5.3 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[no subject]
Bah, my previous attempt didn't build cleanly in a chroot, so I had to patch setup.py. ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 1/2] Build debian package for python-bindings.
From: David Bremner brem...@debian.org This uses dh_python2 (included with sufficiently recent versions of the python/python-all packages). python-all brings in all of the supported versions of python. The double calls to dh_auto_install are to avoid looping over python versions ourselves. --- debian/control| 17 - debian/python-notmuch.install |1 + debian/rules | 14 +- 3 files changed, 30 insertions(+), 2 deletions(-) create mode 100644 debian/python-notmuch.install diff --git a/debian/control b/debian/control index 3491e9a..fa5f762 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,9 @@ Section: mail Priority: extra Maintainer: Carl Worth cwo...@debian.org Uploaders: Jameson Graef Rollins jroll...@finestructure.net, martin f. krafft madd...@debian.org -Build-Depends: debhelper (= 7.0.50~), pkg-config, libxapian-dev, libgmime-2.4-dev, libtalloc-dev, libz-dev, emacs (= 23~) +Build-Depends: debhelper (= 7.0.50~), pkg-config, libxapian-dev, + libgmime-2.4-dev, libtalloc-dev, libz-dev, emacs (= 23~), + python-all (= 2.6.6-3~) Standards-Version: 3.9.1.0 Homepage: http://notmuchmail.org/ Vcs-Git: git://notmuchmail.org/git/notmuch @@ -49,3 +51,16 @@ Description: thread-based email index, search and tagging (development) . This package provides the necessary development libraries and header files to allow you to develop new software using libnotmuch. + +Package: python-notmuch +Architecture: all +Section: python +Depends: ${misc:Depends}, ${python:Depends}, libnotmuch1 +Description: python interface to the notmuch mail search and index library + Notmuch is a system for indexing, searching, reading, and tagging + large collections of email messages in maildir or mh format. It uses + the Xapian library to provide fast, full-text search with a very + convenient search syntax. + . + This package provides a Python interface to the notmuch + functionality, directly interfacing with a shared notmuch library. diff --git a/debian/python-notmuch.install b/debian/python-notmuch.install new file mode 100644 index 000..607c065 --- /dev/null +++ b/debian/python-notmuch.install @@ -0,0 +1 @@ +usr/lib/python* diff --git a/debian/rules b/debian/rules index a4b526c..7343ac2 100755 --- a/debian/rules +++ b/debian/rules @@ -1,11 +1,23 @@ #!/usr/bin/make -f %: - dh $@ + dh --with python2 $@ override_dh_auto_configure: dh_auto_configure -- --emacslispdir=/usr/share/emacs/site-lisp/notmuch +override_dh_auto_build: + dh_auto_build + dh_auto_build --sourcedirectory bindings/python + +override_dh_auto_clean: + dh_auto_clean + dh_auto_clean --sourcedirectory bindings/python + +override_dh_auto_install: + dh_auto_install + dh_auto_install --sourcedirectory bindings/python + override_dh_installdocs: dh_installdocs install -m644 vim/README debian/notmuch/usr/share/doc/notmuch/README.vim -- 1.7.5.3 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH 2/2] Do not import notmuch in setup.py.
From: David Bremner brem...@debian.org Importing notmuch loads the notmuch shared library. When building without a system install of notmuch, this requires e.g. setting LD_LIBRARY_PATH for building and fails completely for cleaning. --- bindings/python/setup.py | 17 - 1 files changed, 16 insertions(+), 1 deletions(-) diff --git a/bindings/python/setup.py b/bindings/python/setup.py index e4a3a25..1497bc4 100644 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -1,7 +1,22 @@ #!/usr/bin/env python +import os +import re from distutils.core import setup -from notmuch import __VERSION__ + +def get_version(): +file = open('notmuch/__init__.py') +try: +for line in file: +if re.match('__VERSION__\s*=\s*',line) != None: +version = line.split('=', 1)[1] +return eval(version, {}, {}) +finally: +file.close() +raise IOError('Unexpected end-of-file') + +__VERSION__=get_version() + setup(name='notmuch', version=__VERSION__, description='Python binding of the notmuch mail search and indexing library.', -- 1.7.5.3 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
[PATCH] debian: break up build-depends on separate lines
For clarity and cleaner future diffs. --- debian/control | 12 +--- 1 files changed, 9 insertions(+), 3 deletions(-) diff --git a/debian/control b/debian/control index fa5f762..8ffa22b 100644 --- a/debian/control +++ b/debian/control @@ -3,9 +3,15 @@ Section: mail Priority: extra Maintainer: Carl Worth cwo...@debian.org Uploaders: Jameson Graef Rollins jroll...@finestructure.net, martin f. krafft madd...@debian.org -Build-Depends: debhelper (= 7.0.50~), pkg-config, libxapian-dev, - libgmime-2.4-dev, libtalloc-dev, libz-dev, emacs (= 23~), - python-all (= 2.6.6-3~) +Build-Depends: + debhelper (= 7.0.50~), + pkg-config, + libxapian-dev, + libgmime-2.4-dev, + libtalloc-dev, + libz-dev, + emacs (= 23~), + python-all (= 2.6.6-3~), Standards-Version: 3.9.1.0 Homepage: http://notmuchmail.org/ Vcs-Git: git://notmuchmail.org/git/notmuch -- 1.7.5.3 ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch
Re: [python] segfaults at Message.get_date
On Sun, Jun 19, 2011 at 5:45 AM, Dmitry Kurochkin dmitry.kuroch...@gmail.com wrote: Hi Sebastian, Patrick. On Sat, 18 Jun 2011 12:30:01 +0200, Sebastian Spaeth sebast...@sspaeth.de wrote: On Fri, 17 Jun 2011 17:10:24 +0100, Patrick Totzke : #0 0x006eb87d in Xapian::Document::Internal::get_value(unsigned int) const () from /usr/lib/sse2/libxapian.so.22 #1 0x006eb952 in Xapian::Document::get_value(unsigned int) const () from /usr/lib/sse2/libxapian.so.22 #2 0x00523963 in notmuch_message_get_date () from /usr/local/lib/libnotmuch.so.1 One question, what type is libnotmuch really returning here? The code: time_t notmuch_message_get_date (notmuch_message_t *message) { ... return Xapian::sortable_unserialise (value); } But Xapian API says that sortable_unserialise() returns floating type double http://xapian.org/docs/apidoc/html/namespaceXapian.html#326fe2d6b0ee59ac9536f3960e8fd99b Convert a string encoded using sortable_serialise back to a floating point number. But time_t is usually a (signed) long and not floating point. Obviously things have worked just fine so far, but is libnotmuch really returning the right type here? Sorry, I expose my total lack of basic C++ knowledge here... Converting double to time_t does not look good. Notmuch converts between time_t and double both when setting and getting the date. I guess it should work good in most cases at least. Perhaps Carl knows better that it is safe. A double will precisely represent integers up to 2^53, so this conversion shouldn't be a problem until the year 285422109 or so. ___ notmuch mailing list notmuch@notmuchmail.org http://notmuchmail.org/mailman/listinfo/notmuch