formatwarning() definition from cherrypy3 incompatible with Python 2.6

Bug #368855 reported by Robert Toscano
42
This bug affects 4 people
Affects Status Importance Assigned to Milestone
cherrypy3 (Debian)
Fix Released
Undecided
Unassigned
cherrypy3 (Ubuntu)
Fix Released
Medium
Unassigned
Jaunty
Fix Released
Undecided
Unassigned

Bug Description

cherrypy3 overwrites method formatwarning() from python warnings module. The method provided by cherrypy3 is incompatible with Python 2.6 and it may throw an TypeError exception:
  File "/var/lib/python-support/python2.6/cherrypy/_cpengine.py", line 77, in startcherrypy.checker()
  File "/var/lib/python-support/python2.6/cherrypy/_cpchecker.py", line 24, in __call__
    method()
  File "/var/lib/python-support/python2.6/cherrypy/_cpchecker.py", line 171, in check_config_namespaces
    self._known_ns(app.config)
  File "/var/lib/python-support/python2.6/cherrypy/_cpchecker.py", line 166, in _known_ns
    warnings.warn(msg)
  File "/usr/lib/python2.6/warnings.py", line 29, in _show_warning
    file.write(formatwarning(message, category, filename, lineno, line))
TypeError: formatwarning() takes exactly 5 arguments (6 given)

The attached patch fixes this issue by adding missing argument (which defaults to None)

TEST CASE:
The simplest Hello World application from http://www.cherrypy.org/wiki/CherryPyTutorial is enough:

import cherrypy

class HelloWorld:
    def index(self):
        return "Hello world!"
    index.exposed = True

cherrypy.quickstart(HelloWorld())

Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :

In order to fix a bug in released version of Ubuntu you have to follow guidelines that are on https://wiki.edubuntu.org/StableReleaseUpdates/ page. Good luck. If you have questions about it just join #ubuntu-motu channe in irc.freenode.net IRC network.

Changed in cherrypy3 (Ubuntu):
assignee: nobody → kklimonda
Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :

I'm assigning this bug to myself as the patch, although it's a small and simple, wont make it to the SRU. Whole cherrypy3 package is outdated (as version 3.0.2 was released in 2007) so there may be more bugs with Python 2.6 compatibility.
We will rebuild this package so it depends on Python 2.3-2.5 and doesn't install modules for Python 2.6..
Unfortunately we can't just upgrade cherrypy3 to 3.1.x version so the other options would be to check whole code for pieces that are incompatible with Python 2.6. If you (Robert) feel like it you can do it and we'll review patch.

Revision history for this message
Robert Toscano (robert-l-toscano) wrote :

So would the upgrade to cherrypy 3.1.x be something that would happen Karmic or submitted to the debian repositories? I definitely understand about the patch not making it into SRU.

I think it would be silly if I combed the codebase for python 2.6 incompatibilities, especially since that's what the cherrypy guys did in their latest release (don't want to duplicate work). I think your rebuilding solution is good for now. Thanks for looking into it.

Revision history for this message
Krzysztof Klimonda (kklimonda) wrote : Re: [Bug 368855] Re: current version not compatible with python 2.6 (Jaunty)

On Wed, Apr 29, 2009 at 12:43 AM, Robert Toscano <<email address hidden>
> wrote:

> So would the upgrade to cherrypy 3.1.x be something that would happen
> Karmic or submitted to the debian repositories? I definitely understand
> about the patch not making it into SRU.

Yes, package will be automatically synced with version from debian unstable
(3.1.1-2 at the moment) during KK development cycle.

> I think it would be silly if I combed the codebase for python 2.6
> incompatibilities, especially since that's what the cherrypy guys did in
> their latest release (don't want to duplicate work). I think your
> rebuilding solution is good for now. Thanks for looking into it.
>

>
> --
> current version not compatible with python 2.6 (Jaunty)
> https://bugs.launchpad.net/bugs/368855
> You received this bug notification because you are a direct subscriber
> of the bug.
>

summary: - current version not compatible with python 2.6 (Jaunty)
+ formatwarning() definition from cherrypy3 incompatible with Python 2.6
Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :

After some more discussion on #ubuntu-motu it was decided to patch this issue and then watch for other bugs and fix them as they come.

description: updated
Changed in cherrypy3 (Ubuntu):
status: New → Confirmed
status: Confirmed → In Progress
Revision history for this message
John Dong (jdong) wrote :

The provided debdiff looks good, ACK for jaunty-proposed from MOTU-SRU.

Please follow up and ensure that the bug is indeed resolved in Karmic.

Changed in cherrypy3 (Ubuntu Jaunty):
status: New → Confirmed
Changed in cherrypy3 (Debian):
status: Unknown → New
Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :

There is still no 3.1.2 in Debian Unstable so I'm attaching debdiffs from 3.0.2
This is full debdiff between 3.0.2 and 3.1.2 - over 550KB.

Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :

This debdiff contains only changes made in debian/ directory for easier review.
Build log upon request.

Changed in cherrypy3 (Ubuntu):
assignee: Krzysztof Klimonda (kklimonda) → nobody
status: In Progress → Confirmed
Revision history for this message
João Pinto (joaopinto) wrote :

Hello,
the debdiff contains the following problems:

Wrong maintainer:
dpkg-source: warning: Version number suggests Ubuntu changes, but Maintainer: does not have Ubuntu address
dpkg-source: warning: Version number suggests Ubuntu changes, but there is no XSBC-Original-Maintainer field

Patches fail to apply:
Applying patch 01_cherryd_location_fix.diff
patching file cherrypy/test/helper.py
Hunk #1 FAILED at 284.
1 out of 1 hunk FAILED -- rejects in file cherrypy/test/helper.py
Patch 01_cherryd_location_fix.diff does not apply (enforce with -f)
make: *** [patch-stamp] Error 1

Revision history for this message
Emmet Hikory (persia) wrote :

I've temporarily unsubscribed the sponsors queue whilst the issues identified are resolved. Please resubscribe if a new candidate for jaunty-proposed is prepared. For karmic, waiting on Debian probably still remains the best choice (at least up through DebianImportFreeze).

Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :

Ugh, I overdone this patch.. I think. It applies perfectly.. on 3.0.2... sigh.. ;)
Attached new debdiff with fixed Maintainer field.

Revision history for this message
Krzysztof Klimonda (kklimonda) wrote :

Also, I forgot to change Maintainer field in SRU patch.. I think I'll have to create a sticky note to remind myself about it.

Revision history for this message
Julien Lavergne (gilir) wrote :

There is now a 3.1.2 version on Debian.

@kklimonda
Could you request a sync for the karmic bug ?

Changed in cherrypy3 (Ubuntu):
importance: Undecided → Medium
status: Confirmed → Incomplete
Revision history for this message
Krzysztof Klimonda (kklimonda) wrote : Re: [Bug 368855] Re: formatwarning() definition from cherrypy3 incompatible with Python 2.6

I believe I have already requested a sync and it was even ACKd by MOTU but I can't find a mail nor bug right now - I don't have an access to any computer other than my phone right now. I'll try to dig up bug number from my mailbox later and see why it isn't synced yet... ok, it looks like someone has pushed a wrong button and instead of 3.1.2-1 version 3.1.1-3 was synced. I'll fill a sync request once again.

"Julien Lavergne" <email address hidden> wrote:

>There is now a 3.1.2 version on Debian.
>
>@kklimonda
>Could you request a sync for the karmic bug ?
>
>** Changed in: cherrypy3 (Ubuntu)
> Importance: Undecided => Medium
>
>** Changed in: cherrypy3 (Ubuntu)
> Status: Confirmed => Incomplete
>
>--
>formatwarning() definition from cherrypy3 incompatible with Python 2.6
>https://bugs.launchpad.net/bugs/368855
>You received this bug notification because you are a direct subscriber
>of the bug.

Revision history for this message
Andrea Veri (av) wrote :

Maybe you mean this:

https://bugs.launchpad.net/ubuntu/+source/cherrypy3/+bug/414501

It seems to be the latest sync processed on karmic.

Revision history for this message
Andrea Veri (av) wrote :

and yeah, it really seems that version 3.1.1-3 got synced instead of the 3.1.2-1 you suggested to sync on the bug title. Just ask for a new sync then.

Revision history for this message
Julien Lavergne (gilir) wrote :

Sync in progress on bug 417043

Changed in cherrypy3 (Ubuntu):
status: Incomplete → In Progress
Revision history for this message
Artur Rona (ari-tczew) wrote :

 cherrypy3 (3.1.2-1) unstable; urgency=low

   * New upstream release (Closes: #528473)
   * debian/rules:
   - use the quilt make include file instead of using custom code; should
     make the package convertable to the new quilt source format
     (Closes: #538677)
   * debian/control:
   - updated Standards-Version with no changes
   * debian/python-cherrypy3.links:
   - fix link to point to the new place where python-support installs files

 -- Gustavo Noronha Silva <email address hidden> Sat, 15 Aug 2009 14:52:43 -0300

Changed in cherrypy3 (Debian):
importance: Unknown → Undecided
status: New → Fix Released
Revision history for this message
Artur Rona (ari-tczew) wrote :

3.1.2-1 synced.

Changed in cherrypy3 (Ubuntu):
status: In Progress → Fix Released
Artur Rona (ari-tczew)
tags: added: patch sru
Revision history for this message
John Dong (jdong) wrote :

Patch (comment 13) looks reasonable. ACK from the SRU team

Revision history for this message
Benjamin Drung (bdrung) wrote :

uploaded cherrypy3 3.0.2-2ubuntu0.1 with updated maintainer to the new policy

Revision history for this message
Jonathan Riddell (jr) wrote : Please test proposed package

Accepted into jaunty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in cherrypy3 (Ubuntu Jaunty):
status: Confirmed → Fix Committed
tags: added: verification-needed
Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

SRU Verification for Jaunty:
I have reproduced the problem with python-cherrypy 3 3.0.2-2 and have verified that the version of python-cherrypy3 3.0.2-2ubuntu0.1 in -proposed fixes the issue. I've verified that the Hello World example is working as expected and that the formatwarning type error has vanished.

Marking as verification-done

tags: added: verification-done
removed: verification-needed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package cherrypy3 - 3.0.2-2ubuntu0.1

---------------
cherrypy3 (3.0.2-2ubuntu0.1) jaunty-proposed; urgency=low

  * Fix formatwarning() method so it's compatible with Python 2.6 (LP: #368855)
 -- Krzysztof Klimonda <email address hidden> Wed, 29 Apr 2009 01:56:11 +0200

Changed in cherrypy3 (Ubuntu Jaunty):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.