Debian Bug report logs - #629699
webhelpers: FTBFS: test_distance_of_time_in_words fails.

version graph

Package: src:webhelpers; Maintainer for src:webhelpers is Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>;

Reported by: Didier Raboud <odyx@debian.org>

Date: Wed, 8 Jun 2011 15:15:02 UTC

Severity: serious

Tags: confirmed, sid, wheezy

Found in version webhelpers/1.3-2

Fixed in version webhelpers/1.3-3

Done: Piotr Ożarowski <piotr@debian.org>

Bug is archived. No further changes may be made.

Forwarded to https://bitbucket.org/bbangert/webhelpers/issue/61

Toggle useless messages

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


Report forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#629699; Package src:webhelpers. (Wed, 08 Jun 2011 15:15:05 GMT) Full text and rfc822 format available.

Acknowledgement sent to Didier Raboud <odyx@debian.org>:
New Bug report received and forwarded. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Wed, 08 Jun 2011 15:15:05 GMT) Full text and rfc822 format available.

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

From: Didier Raboud <odyx@debian.org>
To: submit@bugs.debian.org
Subject: webhelpers: FTBFS: test_distance_of_time_in_words fails.
Date: Wed, 8 Jun 2011 17:13:48 +0200
Source: webhelpers
Version: 1.3-2
Severity: serious
Tags: wheezy sid
User: debian-qa@lists.debian.org
Usertags: qa-ftbfs-20110607 qa-ftbfs
Justification: FTBFS on amd64

Hi,

During a rebuild of all packages in sid, your package failed to build on
amd64.

Relevant part:
> ======================================================================
> FAIL: test_distance_of_time_in_words (test_date.TestDateHelper)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/«BUILDDIR»/webhelpers-1.3/tests/test_date.py", line 24, in test_distance_of_time_in_words
>     self.assertEqual("11 months and 30 days", distance_of_time_in_words(0, 31536000))
> AssertionError: '11 months and 30 days' != '11 months and 29 days'
> 
> ----------------------------------------------------------------------
> Ran 252 tests in 0.800s
> 
> FAILED (failures=1)
> make: *** [test-python2.7] Error 1

The full build log is available from:
   http://people.debian.org/~lucas/logs/2011/06/07/webhelpers_1.3-2_lsid64.buildlog

A list of current common problems and possible solutions is available at 
http://wiki.debian.org/qa.debian.org/FTBFS . You're welcome to contribute!

About the archive rebuild: The rebuild was done on about 50 AMD64 nodes
of the Grid'5000 platform, using a clean chroot.  Internet was not
accessible from the build systems.




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#629699; Package src:webhelpers. (Mon, 04 Jul 2011 18:15:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jakub Wilk <jwilk@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Mon, 04 Jul 2011 18:15:03 GMT) Full text and rfc822 format available.

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

From: Jakub Wilk <jwilk@debian.org>
To: 629699@bugs.debian.org
Cc: control@bugs.debian.org
Subject: Re: Bug#629699: webhelpers: FTBFS: test_distance_of_time_in_words fails.
Date: Mon, 4 Jul 2011 20:10:44 +0200
tags 629699 + confirmed
thanks

* Didier Raboud <odyx@debian.org>, 2011-06-08, 17:13:
>>    self.assertEqual("11 months and 30 days", distance_of_time_in_words(0, 31536000))
>>AssertionError: '11 months and 30 days' != '11 months and 29 days'

Indeed, distance_of_time_in_words returns different values depending on 
the current time (and timezone):

$ export TZ=Europe/Warsaw
$ for d in 01-01 03-01 03-02 03-27 04-02 10-30; do faketime "2011-$d UTC" python -c 'import webhelpers.date as d; print d.distance_of_time_in_words(0, 31536000)'; done
1 year
11 months and 28 days
11 months and 30 days
11 months, 30 days and 1 hour
11 months and 29 days
11 months, 29 days and 23 hours


-- 
Jakub Wilk




Added tag(s) confirmed. Request was from Jakub Wilk <jwilk@debian.org> to control@bugs.debian.org. (Mon, 04 Jul 2011 18:15:05 GMT) Full text and rfc822 format available.

Set Bug forwarded-to-address to 'https://bitbucket.org/bbangert/webhelpers/issue/61'. Request was from Andrey Rahmatullin <wrar@wrar.name> to control@bugs.debian.org. (Thu, 08 Dec 2011 16:57:02 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#629699; Package src:webhelpers. (Fri, 30 Dec 2011 20:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Julien Cristau <jcristau@debian.org>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Fri, 30 Dec 2011 20:39:03 GMT) Full text and rfc822 format available.

Message #19 received at 629699@bugs.debian.org (full text, mbox):

From: Julien Cristau <jcristau@debian.org>
To: 629699@bugs.debian.org
Subject: Re: Bug#629699: webhelpers: FTBFS: test_distance_of_time_in_words fails.
Date: Fri, 30 Dec 2011 21:34:54 +0100
On Mon, Jul  4, 2011 at 20:10:44 +0200, Jakub Wilk wrote:

> tags 629699 + confirmed
> thanks
> 
> * Didier Raboud <odyx@debian.org>, 2011-06-08, 17:13:
> >>   self.assertEqual("11 months and 30 days", distance_of_time_in_words(0, 31536000))
> >>AssertionError: '11 months and 30 days' != '11 months and 29 days'
> 
> Indeed, distance_of_time_in_words returns different values depending
> on the current time (and timezone):
> 
> $ export TZ=Europe/Warsaw
> $ for d in 01-01 03-01 03-02 03-27 04-02 10-30; do faketime "2011-$d UTC" python -c 'import webhelpers.date as d; print d.distance_of_time_in_words(0, 31536000)'; done
> 1 year
> 11 months and 28 days
> 11 months and 30 days
> 11 months, 30 days and 1 hour
> 11 months and 29 days
> 11 months, 29 days and 23 hours
> 
Hi,

does anybody see a reason not to just disable this test?  That seems to
have been done in fedora, fwiw
(http://pkgs.fedoraproject.org/gitweb/?p=python-webhelpers.git;a=commitdiff;h=3949b1c8cbd8baf038c94a815aa8cdbc35dfd4f6)

Cheers,
Julien




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#629699; Package src:webhelpers. (Mon, 02 Jan 2012 09:31:09 GMT) Full text and rfc822 format available.

Acknowledgement sent to Matthias Klose <doko@ubuntu.com>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Mon, 02 Jan 2012 09:31:23 GMT) Full text and rfc822 format available.

Message #24 received at 629699@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@ubuntu.com>
To: 629699@bugs.debian.org
Cc: Julien Cristau <jcristau@debian.org>
Subject: Re: Bug#629699: webhelpers: FTBFS: test_distance_of_time_in_words
Date: Mon, 02 Jan 2012 10:27:13 +0100
the Fedora patch is not enough, it fails later with:

======================================================================
ERROR: test_mimetypes.test_root_path
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 187, in runTest
    self.test(*self.arg)
  File "/home/packages/tmp/webhelpers-1.3/tests/test_mimetypes.py", line 36, in
test_root_path
    eq_(m.mimetype('text/html'), 'text/html')
  File "/home/packages/tmp/webhelpers-1.3/webhelpers/mimehelper.py", line 114,
in mimetype
    self.env['HTTP_ACCEPT'])
TypeError: __init__() takes exactly 2 arguments (3 given)

======================================================================
ERROR: test_mimetypes.test_with_extension
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 187, in runTest
    self.test(*self.arg)
  File "/home/packages/tmp/webhelpers-1.3/tests/test_mimetypes.py", line 44, in
test_with_extension
    eq_(m.mimetype('text/html'), False)
  File "/home/packages/tmp/webhelpers-1.3/webhelpers/mimehelper.py", line 114,
in mimetype
    self.env['HTTP_ACCEPT'])
TypeError: __init__() takes exactly 2 arguments (3 given)

======================================================================
ERROR: test_mimetypes.test_with_unregistered_extention
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 187, in runTest
    self.test(*self.arg)
  File "/home/packages/tmp/webhelpers-1.3/tests/test_mimetypes.py", line 53, in
test_with_unregistered_extention
    eq_(m.mimetype('text/html'), False)
  File "/home/packages/tmp/webhelpers-1.3/webhelpers/mimehelper.py", line 114,
in mimetype
    self.env['HTTP_ACCEPT'])
TypeError: __init__() takes exactly 2 arguments (3 given)

======================================================================
ERROR: test_mimetypes.test_root_path
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 187, in runTest
    self.test(*self.arg)
  File "/home/packages/tmp/webhelpers-1.3/tests/test_mimetypes.py", line 36, in
test_root_path
    eq_(m.mimetype('text/html'), 'text/html')
  File "/home/packages/tmp/webhelpers-1.3/webhelpers/mimehelper.py", line 114,
in mimetype
    self.env['HTTP_ACCEPT'])
TypeError: __init__() takes exactly 2 arguments (3 given)

======================================================================
ERROR: test_mimetypes.test_with_extension
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 187, in runTest
    self.test(*self.arg)
  File "/home/packages/tmp/webhelpers-1.3/tests/test_mimetypes.py", line 44, in
test_with_extension
    eq_(m.mimetype('text/html'), False)
  File "/home/packages/tmp/webhelpers-1.3/webhelpers/mimehelper.py", line 114,
in mimetype
    self.env['HTTP_ACCEPT'])
TypeError: __init__() takes exactly 2 arguments (3 given)

======================================================================
ERROR: test_mimetypes.test_with_unregistered_extention
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/nose/case.py", line 187, in runTest
    self.test(*self.arg)
  File "/home/packages/tmp/webhelpers-1.3/tests/test_mimetypes.py", line 53, in
test_with_unregistered_extention
    eq_(m.mimetype('text/html'), False)
  File "/home/packages/tmp/webhelpers-1.3/webhelpers/mimehelper.py", line 114,
in mimetype
    self.env['HTTP_ACCEPT'])
TypeError: __init__() takes exactly 2 arguments (3 given)




Information forwarded to debian-bugs-dist@lists.debian.org, Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>:
Bug#629699; Package src:webhelpers. (Fri, 20 Apr 2012 12:57:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Colin Watson <cjwatson@ubuntu.com>:
Extra info received and forwarded to list. Copy sent to Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>. (Fri, 20 Apr 2012 12:57:03 GMT) Full text and rfc822 format available.

Message #29 received at 629699@bugs.debian.org (full text, mbox):

From: Colin Watson <cjwatson@ubuntu.com>
To: Matthias Klose <doko@ubuntu.com>, 629699@bugs.debian.org
Cc: Julien Cristau <jcristau@debian.org>
Subject: Re: Bug#629699: webhelpers: FTBFS: test_distance_of_time_in_words
Date: Fri, 20 Apr 2012 13:19:04 +0100
tags 629699 patch
user ubuntu-devel@lists.ubuntu.com
usertags 629699 ubuntu-patch precise
thanks

On Mon, Jan 02, 2012 at 10:27:13AM +0100, Matthias Klose wrote:
> the Fedora patch is not enough, it fails later with:
> 
> ======================================================================
> ERROR: test_mimetypes.test_root_path
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/usr/lib/python2.7/dist-packages/nose/case.py", line 187, in runTest
>     self.test(*self.arg)
>   File "/home/packages/tmp/webhelpers-1.3/tests/test_mimetypes.py", line 36, in
> test_root_path
>     eq_(m.mimetype('text/html'), 'text/html')
>   File "/home/packages/tmp/webhelpers-1.3/webhelpers/mimehelper.py", line 114,
> in mimetype
>     self.env['HTTP_ACCEPT'])
> TypeError: __init__() takes exactly 2 arguments (3 given)

This is due to an API change in WebOb 1.1.1 vs. 1.1 (!).  Here's a patch
(which I guess is in addition to disabling
test_distance_of_time_in_words; but that's trivial, and we have a few
years before it starts being a problem again in TZ=UTC ...).

I've test-built this with both python-webob 1.0.8-1 and 1.1.1-1.  The
first argument to the MIMEAccept constructor was previously used only
for adjusting its header parsing, and 'ACCEPT' invoked the default
behaviour there, so simply omitting it is safe with the new API.

  * Handle API change in WebOb 1.1.1.

diff -Nru webhelpers-1.3/debian/patches/series webhelpers-1.3/debian/patches/series
--- webhelpers-1.3/debian/patches/series	1970-01-01 01:00:00.000000000 +0100
+++ webhelpers-1.3/debian/patches/series	2012-04-20 12:53:09.000000000 +0100
@@ -0,0 +1 @@
+webob_1.1.1.patch
diff -Nru webhelpers-1.3/debian/patches/webob_1.1.1.patch webhelpers-1.3/debian/patches/webob_1.1.1.patch
--- webhelpers-1.3/debian/patches/webob_1.1.1.patch	1970-01-01 01:00:00.000000000 +0100
+++ webhelpers-1.3/debian/patches/webob_1.1.1.patch	2012-04-20 13:10:19.000000000 +0100
@@ -0,0 +1,28 @@
+Description: Handle API change in WebOb 1.1.1
+Author: Colin Watson <cjwatson@ubuntu.com>
+Bug-Debian: http://bugs.debian.org/629699
+Bug-Ubuntu: https://bugs.launchpad.net/bugs/910766
+Forwarded: no
+Last-Update: 2012-04-20
+
+Index: b/webhelpers/mimehelper.py
+===================================================================
+--- a/webhelpers/mimehelper.py
++++ b/webhelpers/mimehelper.py
+@@ -110,8 +110,14 @@
+             if '.' in last_part:
+                 has_extension = True
+         if 'HTTP_ACCEPT' in self.env:
+-            possible_from_accept_header = webob.acceptparse.MIMEAccept('ACCEPT', 
+-                self.env['HTTP_ACCEPT'])
++            try:
++                # WebOb >= 1.1.1
++                possible_from_accept_header = webob.acceptparse.MIMEAccept(
++                    self.env['HTTP_ACCEPT'])
++            except TypeError:
++                # WebOb < 1.1.1
++                possible_from_accept_header = webob.acceptparse.MIMEAccept('ACCEPT',
++                    self.env['HTTP_ACCEPT'])
+         if has_extension == False:
+             if possible_from_accept_header is None:
+                 return self._set_response_content_type(content_type)

Thanks,

-- 
Colin Watson                                       [cjwatson@ubuntu.com]




Reply sent to Piotr Ożarowski <piotr@debian.org>:
You have taken responsibility. (Sat, 07 Jul 2012 18:18:14 GMT) Full text and rfc822 format available.

Notification sent to Didier Raboud <odyx@debian.org>:
Bug acknowledged by developer. (Sat, 07 Jul 2012 18:18:14 GMT) Full text and rfc822 format available.

Message #34 received at 629699-close@bugs.debian.org (full text, mbox):

From: Piotr Ożarowski <piotr@debian.org>
To: 629699-close@bugs.debian.org
Subject: Bug#629699: fixed in webhelpers 1.3-3
Date: Sat, 07 Jul 2012 18:17:13 +0000
Source: webhelpers
Source-Version: 1.3-3

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

python-webhelpers_1.3-3_all.deb
  to main/w/webhelpers/python-webhelpers_1.3-3_all.deb
webhelpers_1.3-3.debian.tar.gz
  to main/w/webhelpers/webhelpers_1.3-3.debian.tar.gz
webhelpers_1.3-3.dsc
  to main/w/webhelpers/webhelpers_1.3-3.dsc



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 629699@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Piotr Ożarowski <piotr@debian.org> (supplier of updated webhelpers 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: SHA512

Format: 1.8
Date: Sat, 07 Jul 2012 19:13:26 +0200
Source: webhelpers
Binary: python-webhelpers
Architecture: source all
Version: 1.3-3
Distribution: unstable
Urgency: low
Maintainer: Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
Changed-By: Piotr Ożarowski <piotr@debian.org>
Description: 
 python-webhelpers - library of helper functions to make writing web application templ
Closes: 629699
Changes: 
 webhelpers (1.3-3) unstable; urgency=low
 .
   * Handle API change in WebOb 1.1.1 (thanks to Colin Watson for the patch
     from Ubuntu)
   * Disable distance_of_time_in_words tests (Closes: 629699)
Checksums-Sha1: 
 9c80491250d60338f7bd68567bdd0cae38ad1c58 2175 webhelpers_1.3-3.dsc
 873fc48c180e15b71569c53ed57511f58a63ac53 7191 webhelpers_1.3-3.debian.tar.gz
 b853d0c2f8aad09291f551e192dbb85a36413a8b 145204 python-webhelpers_1.3-3_all.deb
Checksums-Sha256: 
 1120fca602cdf762bfcc454bffad8ffb6281f1026e16168d4fc504bf2fde2066 2175 webhelpers_1.3-3.dsc
 8ebff04c566f59a5e67d5176d0eb3bd0fa3809f1057a31633a0e344c0579dacf 7191 webhelpers_1.3-3.debian.tar.gz
 0e76f60df37db27a58cccbc81e70fc4a207aeb6455f27eafb3ac4b63cae62102 145204 python-webhelpers_1.3-3_all.deb
Files: 
 50bf1f54ad26c36493e1d0f16c35712f 2175 python optional webhelpers_1.3-3.dsc
 6cc87ebecc2acf3d1d725893732fad68 7191 python optional webhelpers_1.3-3.debian.tar.gz
 1626dbd79b127697d1cbff67a6e9d489 145204 python optional python-webhelpers_1.3-3_all.deb

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

iQIcBAEBCgAGBQJP+HiFAAoJEK728aKnRXZFbRQP/3hQvYTYe6Bbnc9pmTmhWrws
kS8wRUa/UdzR5rFKC0zztI+zjLk2gr6rojAC1AlhFwD/oE70WsRRUDYNUYn9F4p+
OpQcsWxy4RB3C3f4/KqjYrnVAzDRgyKPpKltO9smG2oXstvEr6JvD8CFeq+JFFLO
zfGS87emDBp13z379hzOZQRIDYPvpwxSD8o2VTFNZj4pbRWX19DOeFHYcPEv45XB
x7SXwEUKoXqe8fPsaLlPMyYOlK/ib921xZm2o090muLAX/TChY13vGqs8DHVKDiG
uhD3mio3sBYMMXPLGt8JiTGXPpQZQWhYMlEePEH/P3kdX4sK+cML4hbqXkI54UMP
WTQq1LULEqvENNa34k1bsfUIH7yqbO7Z8PJ48a7soWkHy3Fz7qwu7uLQCUzj6JNl
ze2B7LAeWDIFC5Y0QUeV+risDDEIaEZPuXce/WDcxlD0tQ4fAd8ectHS+fJn/a/U
RtYNS+lI2NLkZUOh5+82/OSNScIE56o4Ea8GwpUpR4GjMOu/lhnkJ6QrdGjNKnXD
YfA5DL6NNxPKSnMJvgcWmBUAusjWYSRfPobfUs55fIYFkmf7xcP1ttw78Fi8Gugf
mT41K1dqkAlXKJKRRnWw259v+ZqodOGdufK5bYu6wnHbIVdD9kbVlZZhZ5xfTge+
j7QBg7Vkn3eyqh53wfbc
=i9ra
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Wed, 22 Aug 2012 07:42:57 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Mon Apr 21 10:44:44 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.