Debian Bug report logs - #622170
pytrainer: Fails after upgrade to 1.8: AttributeError: 'NoneType' object has, no attribute 'read'

version graph

Package: pytrainer; Maintainer for pytrainer is Debian Python Team <team+python@tracker.debian.org>; Source for pytrainer is src:pytrainer (PTS, buildd, popcon).

Reported by: Björn Gustafsson <bjorne-g@telia.com>

Date: Sun, 10 Apr 2011 17:40:08 UTC

Severity: important

Tags: fixed-upstream, patch

Found in version pytrainer/1.8.0-1

Fixed in version pytrainer/1.9.1-1

Done: Christian Perrier <bubulle@debian.org>

Bug is archived. No further changes may be made.

Forwarded to https://sourceforge.net/apps/trac/pytrainer/ticket/118

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Noèl Köthe <noel@debian.org>:
Bug#622170; Package pytrainer. (Sun, 10 Apr 2011 17:40:11 GMT) (full text, mbox, link).


Acknowledgement sent to Björn Gustafsson <bjorne-g@telia.com>:
New Bug report received and forwarded. Copy sent to Noèl Köthe <noel@debian.org>. (Sun, 10 Apr 2011 17:40:12 GMT) (full text, mbox, link).


Message #5 received at submit@bugs.debian.org (full text, mbox, reply):

From: Björn Gustafsson <bjorne-g@telia.com>
To: Debian Bug Tracking System <submit@bugs.debian.org>
Subject: pytrainer: Fails after upgrade to 1.8: AttributeError: 'NoneType' object has, no attribute 'read'
Date: Sun, 10 Apr 2011 19:00:18 +0200
Package: pytrainer
Version: 1.8.0-1
Severity: important

Console output after starting pytrainer:

running pytrainer from egg installation
data_path: /usr/share/pytrainer/
gettext_path: /usr/share/locale
site_path: /usr/lib/python2.6/site-packages
Using xulrunner dir: /usr/lib/xulrunner-1.9.2
Traceback (most recent call last):
  File "/usr/bin/pytr", line 121, in <module>
    main()
  File "/usr/bin/pytr", line 118, in main
    pytrainer = pyTrainer(None, data_path)
  File "/usr/lib/pymodules/python2.6/pytrainer/main.py", line 107, in 
__init__
    self.windowmain.on_calendar_selected(None)
  File "/usr/lib/pymodules/python2.6/pytrainer/gui/windowmain.py", line 
1538,
in on_calendar_selected
    self.parent.refreshListRecords()
  File "/usr/lib/pymodules/python2.6/pytrainer/main.py", line 330, in
refreshListRecords
    self.windowmain.actualize_recordTreeView(record_ids)
  File "/usr/lib/pymodules/python2.6/pytrainer/gui/windowmain.py", line 
1664,
in actualize_recordTreeView
    laps = self.parent.record.getLaps(id_record)
  File "/usr/lib/pymodules/python2.6/pytrainer/record.py", line 356, in 
getLaps
    gpx = Gpx(self.data_path,gpxfile)
  File "/usr/lib/pymodules/python2.6/pytrainer/lib/gpx.py", line 104, in
__init__
    self.Values = self._getValues()
  File "/usr/lib/pymodules/python2.6/pytrainer/lib/gpx.py", line 223, in
_getValues
    mk_time = self.getDateTime(date_)[1] #Local Date
  File "/usr/lib/pymodules/python2.6/pytrainer/lib/gpx.py", line 135, in
getDateTime
    return Date().getDateTime(time_)
  File "/usr/lib/pymodules/python2.6/pytrainer/lib/date.py", line 184, in
getDateTime
    dateTime = dateutil.parser.parse(time_)
  File "/usr/lib/pymodules/python2.6/dateutil/parser.py", line 697, in 
parse
    return DEFAULTPARSER.parse(timestr, **kwargs)
  File "/usr/lib/pymodules/python2.6/dateutil/parser.py", line 301, in 
parse
    res = self._parse(timestr, **kwargs)
  File "/usr/lib/pymodules/python2.6/dateutil/parser.py", line 349, in 
_parse
    l = _timelex.split(timestr)
  File "/usr/lib/pymodules/python2.6/dateutil/parser.py", line 143, in 
split
    return list(cls(s))
  File "/usr/lib/pymodules/python2.6/dateutil/parser.py", line 137, in next
    token = self.get_token()
  File "/usr/lib/pymodules/python2.6/dateutil/parser.py", line 68, in 
get_token
    nextchar = self.instream.read(1)
AttributeError: 'NoneType' object has no attribute 'read'



-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (990, 'testing'), (500, 'oldstable'), (500, 'unstable'), 
(500, 'stable'), (1, 'experimental')
Architecture: i386 (i686)

Kernel: Linux 2.6.32-5-686 (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=sv_SE.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages pytrainer depends on:
ii  gpsbabel                   1.4.2-2       GPS file conversion plus 
transfer
ii  iceweasel                  3.5.18-1      Web browser based on Firefox
ii  python                     2.6.6-12      interactive high-level 
object-orie
ii  python-glade2              2.17.0-4      GTK+ bindings: Glade support
ii  python-gtk2                2.17.0-4      Python bindings for the 
GTK+ widge
ii  python-gtkmozembed         2.25.3-7      Python bindings for the 
GtkMozEmbe
ii  python-libxml2             2.7.8.dfsg-2  Python bindings for the 
GNOME XML
ii  python-lxml                2.3-0.1       pythonic binding for the 
libxml2 a
ii  python-matplotlib          0.99.3-1      Python based plotting 
system in a
ii  python-numpy               1:1.4.1-5     Numerical Python adds a 
fast array
ii  python-pysqlite2           2.6.3-1       Python interface to SQLite 3
ii  python-scipy               0.7.2+dfsg1-1 scientific tools for Python
ii  python-soappy              0.12.0-4      SOAP Support for Python
ii  python-support             1.0.11        automated rebuilding 
support for P
ii  zenity                     2.30.0-1      Display graphical dialog 
boxes fro

pytrainer recommends no packages.

pytrainer suggests no packages.

-- no debconf information




Information forwarded to debian-bugs-dist@lists.debian.org, Noèl Köthe <noel@debian.org>:
Bug#622170; Package pytrainer. (Sun, 24 Apr 2011 16:48:08 GMT) (full text, mbox, link).


Acknowledgement sent to Xavier Bassery <xavier@bartica.org>:
Extra info received and forwarded to list. Copy sent to Noèl Köthe <noel@debian.org>. (Sun, 24 Apr 2011 16:48:08 GMT) (full text, mbox, link).


Message #10 received at 622170@bugs.debian.org (full text, mbox, reply):

From: Xavier Bassery <xavier@bartica.org>
To: <622170@bugs.debian.org>
Subject: Re: Bug#622170: pytrainer: Fails after upgrade to 1.8: AttributeError: 'NoneType' object has, no attribute 'read'
Date: Sun, 24 Apr 2011 18:33:17 +0200
[Message part 1 (text/plain, inline)]
Tags: patch

It seems that at least one of your gpx file (in ~/.pytrainer/gpx/) has his time tag with no value.
As a workaround, you could add a value like 2008-08-22T13:14:25Z , it should allow you to see the record.

That said, this is indeed a bug.
pytrainer calls dateutil.parser.parse(time_) (in pytrainer/lib/date.py, function getDateTime) even if time_ is empty.
dateutil.parser.parse(None) raises an AttributeError.
The pytrainer code has exception handling for ValueError only, so it fails to catch this case.

Should dateutil.parser.parse checks for None values and raise a ValueError (instead of an AttributeError) or should pytrainer do the check?
The answer may be both.

I have joined a patch to do the check in pytrainer.

[debbug_622170.patch (application/octet-stream, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Noèl Köthe <noel@debian.org>:
Bug#622170; Package pytrainer. (Sun, 24 Apr 2011 17:39:06 GMT) (full text, mbox, link).


Acknowledgement sent to Xavier Bassery <xavier@bartica.org>:
Extra info received and forwarded to list. Copy sent to Noèl Köthe <noel@debian.org>. (Sun, 24 Apr 2011 17:39:06 GMT) (full text, mbox, link).


Message #15 received at 622170@bugs.debian.org (full text, mbox, reply):

From: Xavier Bassery <xavier@bartica.org>
To: <622170@bugs.debian.org>
Date: Sun, 24 Apr 2011 19:37:13 +0200
tags 622170  patch
thanks







Added tag(s) patch. Request was from Xavier Bassery <xavier@bartica.org> to control@bugs.debian.org. (Sun, 24 Apr 2011 18:09:18 GMT) (full text, mbox, link).


Set Bug forwarded-to-address to 'https://sourceforge.net/apps/trac/pytrainer/ticket/118'. Request was from Christian Perrier <bubulle@debian.org> to control@bugs.debian.org. (Sun, 01 May 2011 21:06:36 GMT) (full text, mbox, link).


Added tag(s) fixed-upstream. Request was from Christian Perrier <bubulle@debian.org> to control@bugs.debian.org. (Mon, 02 May 2011 20:21:11 GMT) (full text, mbox, link).


Reply sent to Christian Perrier <bubulle@debian.org>:
You have taken responsibility. (Sun, 27 Nov 2011 17:27:15 GMT) (full text, mbox, link).


Notification sent to Björn Gustafsson <bjorne-g@telia.com>:
Bug acknowledged by developer. (Sun, 27 Nov 2011 17:27:15 GMT) (full text, mbox, link).


Message #26 received at 622170-close@bugs.debian.org (full text, mbox, reply):

From: Christian Perrier <bubulle@debian.org>
To: 622170-close@bugs.debian.org
Subject: Bug#622170: fixed in pytrainer 1.9.1-1
Date: Sun, 27 Nov 2011 17:22:31 +0000
Source: pytrainer
Source-Version: 1.9.1-1

We believe that the bug you reported is fixed in the latest version of
pytrainer, which is due to be installed in the Debian FTP archive:

pytrainer_1.9.1-1.debian.tar.gz
  to main/p/pytrainer/pytrainer_1.9.1-1.debian.tar.gz
pytrainer_1.9.1-1.dsc
  to main/p/pytrainer/pytrainer_1.9.1-1.dsc
pytrainer_1.9.1-1_all.deb
  to main/p/pytrainer/pytrainer_1.9.1-1_all.deb
pytrainer_1.9.1.orig.tar.bz2
  to main/p/pytrainer/pytrainer_1.9.1.orig.tar.bz2



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 622170@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Christian Perrier <bubulle@debian.org> (supplier of updated pytrainer package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sun, 27 Nov 2011 17:52:03 +0100
Source: pytrainer
Binary: pytrainer
Architecture: source all
Version: 1.9.1-1
Distribution: unstable
Urgency: low
Maintainer: Debian running development group <pkg-running-devel@lists.alioth.debian.org>
Changed-By: Christian Perrier <bubulle@debian.org>
Description: 
 pytrainer  - tool for logging sport activities
Closes: 560907 587997 622170 624136 645960 647751 648600
Changes: 
 pytrainer (1.9.1-1) unstable; urgency=low
 .
   * New upstream release. This closes the following bugs from Debian
     BTS:
     - Portuguese translation. Closes: #645960
     - German translation. Closes: #647751
     - Wrong name for Danish translation. Closes: #624136
     - New upstream release. Closes: #648600
     - Fixed run failure un mipsel. Closes: #587997
     - Fixed "AttributeError: 'NoneType' object has, no attribute 'read'"
       Closes: #622170
   * Drop debian/pytrainer.1 as upstream now provides a manpage
     (which we to to build at build time)
   * Warn users about the lengthy database migration process, in
     NEWS.Debian
   * Fix synopsis in upstream manpage
   * Move pytr in /usr/lib/pytrainer as we're using a wrapper. That
     will also avoid a lintian warning about a missing manpage.
     Closes: #560907
   * Depend on python-migrate to allow database migration at first run
   * Bump Standards to 3.9.2 (checked)
   * Bump debhelper compatibility to 8
   * Use dh7-style debian/rules
Checksums-Sha1: 
 30f75ab8c22769ec46e2603e32b447c883afd35a 1909 pytrainer_1.9.1-1.dsc
 f46991887b2fca35be16b330f94aafc46357abea 393044 pytrainer_1.9.1.orig.tar.bz2
 182516aa63eee924850b111972e993d8cded5447 7563 pytrainer_1.9.1-1.debian.tar.gz
 7081dacb4ff7c5422c78b8af9863cb16475c3549 405990 pytrainer_1.9.1-1_all.deb
Checksums-Sha256: 
 0ff37621cb0fdde6d7afb433e289f2e318328b61f0732d60cbe9113695b85259 1909 pytrainer_1.9.1-1.dsc
 76c4964616e368e51e937917c359010956b7a21380afd0fd0a4dbb993b7757ac 393044 pytrainer_1.9.1.orig.tar.bz2
 14c4440eb706c9e226ead5ba9d5af186d313dd0f73f13b5414653b3051040a92 7563 pytrainer_1.9.1-1.debian.tar.gz
 9cb561d4e527355c9bd0b34e9d1f2621d0b56078dd5f977ae8fa0ee14655f628 405990 pytrainer_1.9.1-1_all.deb
Files: 
 83bc39b8e401d5dbf96a5e35ebdf9c97 1909 utils optional pytrainer_1.9.1-1.dsc
 00038223a22f155a86188ca9eb5d215d 393044 utils optional pytrainer_1.9.1.orig.tar.bz2
 f13197fce193938f0ce23c9404b47c3c 7563 utils optional pytrainer_1.9.1-1.debian.tar.gz
 2b1e86548f01fcbcbe4655b5e4ab9d00 405990 utils optional pytrainer_1.9.1-1_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIVAwUBTtJsBYcvcCxNbiWoAQLXKw/8DJVcr+uDePQ1b/O4hiIfCEeo8jbzcpfO
Rz1vQImAkzsISeOcivPRtrKlx3Zc3DlANgotWFHdoJoz2frkhdblmeuFHJ52wwR6
qw1uj9WXP9rXldSOcrGXSMf7+ThGd1BINeHzusG0hmNoPYzNVz5Ssmtjx61kaeI9
ura0v/wjJzrFJ1yMwLEcCYJxqkxMQo1CeSKHlf/5/ofdOQx6xK6SYMIx4Xeom1p8
RWxMdumlajNnfz3ga1DacungTQFZYmPuvRSQoDRyncxupVaPJcv+570uLhHC3FXm
1GXPXqKKYCl94pYVU/KQ0fikK6Fo+SQqwgVBJzd5IJsSQPOqaPEzRZWxax3bniEj
vPZSO09BWx/GLeLyu+VJr+d1pLVlGKZlhk/iEiRje72BAmNbIRBfryq0+e2DFSZX
f4qG/qAb8qk3txDkF4ER3CmMlmb5im725EBnt91oqUIL/x9RXZF9ZXDWHqI19g53
ZoQiInZ5tNXYutG9izNikPgVuzHuX4ADQZpKj+pU0TxnsmT4a6l+v/w6Y1vPKeLn
yWIEV7iEFG5ILt35/aGrotP2sLIJgL6wDHcGLLgLcOl9yYlEHBdL01uK8XxXocw2
1k5iYikNlwO2ekIWG6oDgUrOhQ2XpQ8CRjG8nF4RO43hjXVB8nj5pSPSG47iqEdk
HyAXcmceVNQ=
=KXw2
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Mon, 26 Dec 2011 07:37:35 GMT) (full text, mbox, link).


Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sat Jul 1 15:15:57 2023; Machine Name: bembo

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.