[Debian-med-packaging] Bug#730166: AttributeError: 'NoneType' object has no attribute 'group'

Philipp Kern pkern at debian.org
Fri Nov 22 18:08:11 UTC 2013


tag 730166 + patch
thanks

On Fri, Nov 22, 2013 at 09:02:55AM +0100, Mathieu Malaterre wrote:
> For some reason tifffile does not work anymore:
> 
> $ tifffile
> Traceback (most recent call last):
>   File "/usr/bin/tifffile", line 7, in <module>
>     sys.exit(tifffile.main())
>   File "/usr/lib/python2.6/dist-packages/tifffile.py", line 2976, in main
>     description=search_doc("\n\n([^|]*?)\n\n", ''),
>   File "/usr/lib/python2.6/dist-packages/tifffile.py", line 2973, in <lambda>
>     search_doc = lambda r, d: re.search(r, __doc__).group(1) if __doc__ else d
> AttributeError: 'NoneType' object has no attribute 'group'

I think it'd make sense to just take the first line of the module
docstring as documentation:

--- tifffile.py.orig	2013-11-22 18:53:39.107471300 +0100
+++ tifffile.py	2013-11-22 19:06:36.245232148 +0100
@@ -2973,7 +2973,7 @@
     search_doc = lambda r, d: re.search(r, __doc__).group(1) if __doc__ else d
     parser = optparse.OptionParser(
         usage="usage: %prog [options] path",
-        description=search_doc("\n\n([^|]*?)\n\n", ''),
+        description=search_doc("^([^\n]+)", ""),
         version="%%prog %s" % search_doc(":Version: (.*)", "Unknown"))
     opt = parser.add_option
     opt('-p', '--page', dest='page', type='int', default=-1,

Kind regards
Philipp Kern
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 490 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/debian-med-packaging/attachments/20131122/ea2e8679/attachment-0001.sig>


More information about the Debian-med-packaging mailing list