Your message dated Fri, 08 May 2009 10:47:09 +0000
with message-id <[email protected]>
and subject line Bug#525770: fixed in python-django-tagging 0.2.1+svn154-2
has caused the Debian Bug report #525770,
regarding python-django-tagging: _calculate_tag_weight() may return value which 
is greater than max_weight.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
525770: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=525770
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: python-django-tagging
Version: 0.2.1+svn147-1
Severity: important
Tags: patch
User: [email protected]
Usertags: origin-ubuntu jaunty ubuntu-patch

Current version of package ``python-django-tagging'' has a long standing bug
in a _calculate_tag_weight() method.

When a programmer creates tag cloud using method util.calculate_cloud()
or Tag.objects.cloud_for_model() and sets distribution argument to
``LOGARITHMIC'' (or leave it empty as it is default value)
_calculate_tag_weight() in some cases may return result which is greater
than max_weight - because of that Tag object (the one most frequently
used in model) will be missing argument ``font_size'' and throw AttributeError
exception. It happens because of the way a floating point division is done
in Python.

The proposed patch address this issue by returning ``max_weight'' in case when
result of computation is greater than it.

A link to upstream bugreport: 
http://code.google.com/p/django-tagging/issues/detail?id=91

In LP bug there is a simple testcase which shows this issue.

*** /tmp/tmpRSdnGr
In Ubuntu, we've applied the attached patch to achieve the following:

  * debian/patches/02_fix_calculate_tag_weight.patch: Fix error in
    _calculate_tag_weight method which in some cases may lead 
    to font_size attribute of most frequently used tag to be left unset.
    (LP: #367214)

We thought you might be interested in doing the same. 


-- System Information:
Debian Release: 5.0
  APT prefers jaunty-updates
  APT policy: (500, 'jaunty-updates'), (500, 'jaunty-security'), (500, 'jaunty')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.28-11-generic (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--- 
python-django-tagging-0.2.1+svn154.orig/debian/patches/02_fix_calculate_tag_weight.patch
+++ 
python-django-tagging-0.2.1+svn154/debian/patches/02_fix_calculate_tag_weight.patch
@@ -0,0 +1,15 @@
+Comment: When logarithmic distribution is used _calculate_tag_weight may
+return weight greater than maximum threshold. Because of this the attribute
+``font_size'' of the most frequently used tag may be left unset.
+--- django-tagging.old/tagging/utils.py        (revision 132)
++++ django-tagging/tagging/utils.py    (working copy)
+@@ -230,7 +230,7 @@
+     if distribution == LINEAR or max_weight == 1:
+         return weight
+     elif distribution == LOGARITHMIC:
+-        return math.log(weight) * max_weight / math.log(max_weight)
++        return min((max_weight, math.log(weight) * max_weight / 
math.log(max_weight)))
+     raise ValueError(_('Invalid distribution algorithm specified: %s.') % 
distribution)
+ 
+ def calculate_cloud(tags, steps=4, distribution=LOGARITHMIC):
+

--- End Message ---
--- Begin Message ---
Source: python-django-tagging
Source-Version: 0.2.1+svn154-2

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

python-django-tagging_0.2.1+svn154-2.diff.gz
  to 
pool/main/p/python-django-tagging/python-django-tagging_0.2.1+svn154-2.diff.gz
python-django-tagging_0.2.1+svn154-2.dsc
  to pool/main/p/python-django-tagging/python-django-tagging_0.2.1+svn154-2.dsc
python-django-tagging_0.2.1+svn154-2_all.deb
  to 
pool/main/p/python-django-tagging/python-django-tagging_0.2.1+svn154-2_all.deb



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 [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Raphael Hertzog <[email protected]> (supplier of updated python-django-tagging 
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 [email protected])


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

Format: 1.8
Date: Fri, 08 May 2009 12:30:16 +0200
Source: python-django-tagging
Binary: python-django-tagging
Architecture: source all
Version: 0.2.1+svn154-2
Distribution: unstable
Urgency: low
Maintainer: Debian Python Modules Team 
<[email protected]>
Changed-By: Raphael Hertzog <[email protected]>
Description: 
 python-django-tagging - A generic tagging application for Django projects
Closes: 525770
Changes: 
 python-django-tagging (0.2.1+svn154-2) unstable; urgency=low
 .
   * Apply patch to fix weight of tag when using logarithmic distribution.
     Closes: #525770
Checksums-Sha1: 
 a0c7b5b1f75bc7e93987aee10add62bed153caed 1576 
python-django-tagging_0.2.1+svn154-2.dsc
 e2a6eb2d5b136689c369e345326a1048deb66f07 3436 
python-django-tagging_0.2.1+svn154-2.diff.gz
 1cab98a2723778a91b402b9a479985dbe62a8cef 43794 
python-django-tagging_0.2.1+svn154-2_all.deb
Checksums-Sha256: 
 85c0a1ab009bbf5c5bd004f12cb0e8c6a11512df07696590367577d8e52b7fe1 1576 
python-django-tagging_0.2.1+svn154-2.dsc
 a7997e7c78850df5e3879e9f0fb9e07b7479bfa419a5b8189e351472c7f3802f 3436 
python-django-tagging_0.2.1+svn154-2.diff.gz
 e666fbfe0b3ef48096d41504bdad607f0c59bddc87a18ec5d6f61dc77b1f15d9 43794 
python-django-tagging_0.2.1+svn154-2_all.deb
Files: 
 6fb129a15cbdf90eb099a0b1f6a877b3 1576 python optional 
python-django-tagging_0.2.1+svn154-2.dsc
 2c6705c9910b4bfd786c40af856d23bc 3436 python optional 
python-django-tagging_0.2.1+svn154-2.diff.gz
 e5a470dfb5b1611a84a18c3fe979df2c 43794 python optional 
python-django-tagging_0.2.1+svn154-2_all.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Signed by Raphael Hertzog

iEYEARECAAYFAkoECysACgkQvPbGD26BadJpQgCfUcaHT2DsqkY22HlSoPsziMCH
VroAnjS2aAd0e+R1LTV7L6x2jQtqLr5b
=qTNF
-----END PGP SIGNATURE-----



--- End Message ---
_______________________________________________
Python-modules-team mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/python-modules-team

Reply via email to