popen2 is deprecated.

Bug #617872 reported by David Ramsden
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
pysieved (Debian)
Fix Released
Unknown
pysieved (Ubuntu)
Fix Released
High
Daniel Hahler

Bug Description

Binary package hint: pysieved

When starting pysieved:

/usr/share/pysieved/plugins/dovecot.py:27: DeprecationWarning: The popen2 module is deprecated. Use the subprocess module.
   import popen2

Tags: patch

Related branches

Revision history for this message
David Ramsden (david-hexstream) wrote :

# uname -a
Linux hexstream 2.6.32-24-generic #39-Ubuntu SMP Wed Jul 28 06:07:29 UTC 2010 i686 GNU/Linux

# lsb_release -rd
Description: Ubuntu 10.04.1 LTS
Release: 10.04

# apt-cache policy pysieved
pysieved:
  Installed: 1.0-1
  Candidate: 1.0-1
  Version table:
 *** 1.0-1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ lucid/universe Packages
        100 /var/lib/dpkg/status

Revision history for this message
Aleksandr Koltsoff (czr) wrote :

Easy fix meanwhile (temporary one) is to comment lines 12 and 13 of /usr/lib/python2.6/popen2.py

This at least won't confuse the sieve protocol readers so much. And yes, it's not a real fix.

Revision history for this message
David Ramsden (david-hexstream) wrote :

Until yesterday I hadn't touched Python but I've attached a patch that corrects /usr/share/pysieved/plugins/dovecot.py and removes the use of popen2() and uses popen from subprocess. The code may not be "technically correct" but it works for me. Although I do see defunct Python processes after using Roundcube to create/edit filters. I've not checked if the original version did this.

Also the location of the sievec binary in dovecot has changed and this is corrected in the patch. And /etc/pysieved.ini should also be changed to reflect this.

Should another bug be opened against pysieved in Lucid Lynx regarding the change in sievec binary location?

tags: added: patch
Revision history for this message
Daniel Hahler (blueyed) wrote :

Marking the bug triaged and with High prio: at least when using the inetd mechanism this causes the deprecation warning to be sent to the client (e.g. Thunderbird), which does not handle this properly and times out:

  Parsing Exception in libManageSieve/Sieve.js:
  NO, OK or BYE expected in/usr/share/pysieved/plugins/dovecot.py:27: DeprecationWarning: The popen2 module is deprecated. Use the subprocess module.
    import popen2

Changed in pysieved (Ubuntu):
status: New → Triaged
importance: Undecided → High
Revision history for this message
Daniel Hahler (blueyed) wrote :

This has been fixed upstream in the dev branch [1] at http://gitorious.org/pysieved/pysieved/commit/fa3e6b39bfd1b5b1421bfd3769f4fa1fb9ab2ef4 and http://gitorious.org/pysieved/pysieved/commit/df0253b523a43ec2b65d452d8e347d3f28905b44

The path for "sievec" should get changed via the config file /etc/pysieved.ini, instead of by patching the code. This is the opinion of upstream, too.

1: http://gitorious.org/pysieved/pysieved/commits/dev

Daniel Hahler (blueyed)
Changed in pysieved (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Daniel Hahler (blueyed)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package pysieved - 1.0-1ubuntu1

---------------
pysieved (1.0-1ubuntu1) natty; urgency=low

  * Correct path for sievec in Dovecot via ini file (part of LP: #617872)
    - debian/patches/02_dovecot_sievec_path.dpatch
  * Filter DeprecationWarning "The popen2 module is deprecated" (LP: #617872)
    This is easier than backporting the code using the subprocess module,
    which depends on some other refactoring.
    - debian/patches/50_suppress_deprecation_warning_popen2.dpatch
 -- Daniel Hahler <email address hidden> Fri, 17 Dec 2010 00:26:40 +0100

Changed in pysieved (Ubuntu):
status: In Progress → Fix Released
Changed in pysieved (Debian):
status: Unknown → New
Changed in pysieved (Debian):
status: New → 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.