wicd doesnt like python 2.7

Bug #602825 reported by Fredrik on 2010-07-07
This bug affects 8 people
Affects Status Importance Assigned to Milestone
David Paleino
PLD Linux
wicd (Arch Linux)
wicd (Ubuntu)

Bug Description

wicd 1.7 pukes these lines out then dies with python 2.7:

wicd initializing...
wicd is version 1.7.0 552
setting backend to external
Traceback (most recent call last):
  File "/usr/share/wicd/daemon/wicd-daemon.py", line 1839, in <module>
  File "/usr/share/wicd/daemon/wicd-daemon.py", line 1803, in main
    daemon = WicdDaemon(wicd_bus, auto_connect=auto_connect)
  File "/usr/share/wicd/daemon/wicd-daemon.py", line 115, in __init__
  File "/usr/share/wicd/daemon/wicd-daemon.py", line 885, in ReadConfig
    self.SetBackend(app_conf.get("Settings", "backend", default=be_def))
  File "/usr/share/wicd/daemon/wicd-daemon.py", line 220, in SetBackend
    self.config.set("Settings", "backend", backend, write=True)
  File "/usr/lib/python2.7/site-packages/wicd/configmanager.py", line 76, in set
    self.set_option(*args, **kargs)
  File "/usr/lib/python2.7/site-packages/wicd/configmanager.py", line 72, in set_option
  File "/usr/lib/python2.7/site-packages/wicd/configmanager.py", line 192, in write
    p = copy.deepcopy(self)
  File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python2.7/copy.py", line 298, in _deepcopy_inst
    state = deepcopy(state, memo)
  File "/usr/lib/python2.7/copy.py", line 163, in deepcopy
    y = copier(x, memo)
  File "/usr/lib/python2.7/copy.py", line 257, in _deepcopy_dict
    y[deepcopy(key, memo)] = deepcopy(value, memo)
  File "/usr/lib/python2.7/copy.py", line 174, in deepcopy
    y = copier(memo)
TypeError: cannot deepcopy this pattern object

Related branches

Adam Blackburn (adamblackburn) wrote :

What distro is this on? I'll take a look at it but I'm not running any distros with Python 2.7 so I'll have to install something.

Changed in wicd:
status: New → Incomplete
evil_core (krzysztof-krakowiak) wrote :

I got it too on PLD Th-test repository (pld-linux.org)

Bela Markus (bmarkus) wrote :

I'm getting the same deepcopy related error message running WICD 1.7 with Python 2.7 on Tiny Core Linux 3.0rc1

On the system it works fine with Python 2.6.5

Adam Blackburn (adamblackburn) wrote :

I've been looking into it, and it appears there are a couple things that might be affecting it (I'm still not sure what is doing it exactly):

From the Python2.7 What's New document (http://docs.python.org/whatsnew/2.7.html):
The copy module’s deepcopy() function will now correctly copy bound instance methods. (http://bugs.python.org/issue1515)


http://mail.python.org/pipermail/python-dev/2008-November/083348.html which seems to indicate that copying compiled regular expressions no longer works in 2.5. But, this was not a problem in 2.5, so I don't think this is it.

any other thoughts?

Changed in wicd:
status: Incomplete → Confirmed
importance: Undecided → High
Bela Markus (bmarkus) wrote :

It works fine with Python 2.6.5 so it is Python 2.7

Adam Blackburn (adamblackburn) wrote :

Yes. I wonder if fixing the deepcopy module broke our use of it.

Bela Markus (bmarkus) wrote :

Hi, just wonder, any progress? I know, it is August.... Not pushing :(

Adam Blackburn (adamblackburn) wrote :

I still don't know what the problem is. I think the best thing to do is probably going to be remove the offending code (only one person I know of uses it: the person who contributed the patch) -- either that or add in some logic to detect Python 2.7 and skip the broken part. I'll see about that soon.

Bela Markus (bmarkus) wrote :

Thanks for the response Adam. To be honest I do not know the end user functionality of this code, how and when is it use (what would be missing removing it).

What is about enabling/disabling it manually?

Adam Blackburn (adamblackburn) wrote :

I believe the problematic code allows for a conf.d directory for putting pre-determined wireless configurations in to make it easier for system administrators to configure, so for 99% of end users, there would be nothing missing. I'm not even sure that this feature is documented.

Adam Blackburn wrote:

> I believe the problematic code allows for a conf.d directory for putting
> pre-determined wireless configurations in to make it easier for system
> administrators to configure,


> so for 99% of end users, there would be
> nothing missing. I'm not even sure that this feature is documented.

I ran this past a friend of mine who is a Python expert and also had
a patch accepted to the 2.7 version of deepcopy. He said that his
patch has definitely not caused this, but that this:

     File "/usr/lib/python2.7/copy.py", line 174, in deepcopy
       y = copier(memo)
   TypeError: cannot deepcopy this pattern object

suggests that the pattern object is missing a deepcopy method.

Erik de Castro Lopo

Adam Blackburn (adamblackburn) wrote :

Any idea why this would have shown up in Python 2.7?

In Python 2.6.5:
>>> copy.deepcopy(re.compile(r'\w+'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/copy.py", line 173, in deepcopy
    y = copier(memo)
TypeError: cannot deepcopy this pattern object

Why does this only show up with Python 2.7 if 2.6 cannot copy regular expressions either?

fredrik (fredrik-obra) wrote :

There doesn't happen to be a patch removing the offending code, does it?

Bela Markus (bmarkus) wrote :

Yeah. remove it at least for testing and see result. I'm ready to publish it for Tiny Core Linux as a test version just to get feedback :)

Bela Markus (bmarkus) wrote :

Just curious, is there any progress?

Bela Markus (bmarkus) wrote :

Something new?

Is there ANY workaround for this problem? Like commenting out some code? Reverting to Python 6.x would mean reverting LOTs of packages and it would be real PiTA :(

Andrew Psaltis (nacl) wrote :

There is currently no patch for this available to fix this issue. The developers are currently busy and do not expect not to be in the near future.

The problem code appears to be in "configmanager.py", and is related to the deepcopy module. One could conceivably go and comment out the offending code. If someone has the time to go figure out what the offending code is and remove it, I could add the patch in assuming that everything functions as it once did.

Ionut Biru (ionut.biru) wrote :

we are experiencing this bug in archlinux. we switched today to python 2.7 and we really appreciate if this is fixed in th near future

Adam Blackburn (adamblackburn) wrote :

According to http://www.archlinux.org/packages/5/?q=python&sort=pkgname Python in Archlinux is still 2.6. Regardless, I'll try and get a patch to remove the offending code out within a week or so.

Ionut Biru (ionut.biru) wrote :

python2 2.7 is actually in testing.


it would be a big mistake to push python 2.7 in extra without even testing it no? :)

Alex Chen (alx901) wrote :

My very like wicd, but now all broken. ;-(
Please fix this problem with python.

Hi all,
To make wicd-daemon.py start, replace the body of method write in /usr/lib/python2.7/site-packages/wicd/configmanager.py (at the end of the file) to pass:

    def write(self):

I've checked the files managed by ConfigManager in my box and all of them are empty,
so I think in my box there shouldn't be any problem with this workaround.
The files managed by ConfigManager are:

The problem now is that, after the daemon and the GUI starts, when I try to connect to any network wicd-gtk says "Disactivating active connections" or something like that and the loading bar freezes. It connects to the network anyways, but then I can't disconnect unless closing wicd-gtk. The last lines of the log file are:
2010/10/05 16:03:47 :: dhcpcd[2241]: forked to background, child pid 2267
2010/10/05 16:03:47 ::
2010/10/05 16:03:47 ::
2010/10/05 16:03:47 :: DHCP connection successful
2010/10/05 16:03:47 :: not verifying
2010/10/05 16:03:47 :: Connecting thread exiting.

wicd version: 1.7.0
Distro: ArchLinux

Hope it helps =)

Rémy Oudompheng (oudomphe) wrote :


I would like to suggest a patch which is supposed to preserve functionality.

archex (archex) on 2010-10-07
Changed in wicd (Arch Linux):
status: New → Confirmed
archex (archex) wrote :

I tried the wicd-no-deepcopy.patch on my Arch Linux.
Now it works again, but i have to remove my /etc/wicd/wireless-settings.conf every time before starting the wicd daemon or i get the following error in /var/log/wicd/wicd.log (http://pastebin.com/vnGkRRcZ):
ConfigParser.ParsingError: File contains parsing errors: /etc/wicd/wireless-settings.conf

Maybe there are more Python2.7 incompabilities..?

uzsolt (udvzsolt) wrote :

Same error in PLD linux as Alex (with wicd-no-deepcopy.patch).

archex (archex) wrote :


Changing the line 38 of wicd/configmanager.py to:
RawConfigParser.__init__(self, allow_no_value=True)
seems to solve the config error.

Adam Blackburn (adamblackburn) wrote :

This is fixed in Wicd's trunk and will be released in 1.7.1 in the next couple of days. Thanks to Rémy Oudompheng and Archlinux for the patch to fix this.

(btw, I used the patch from http://repos.archlinux.org/wsvn/packages/wicd/trunk/deepcopy%2Bpython27-fixes.patch instead of the one in this thread as it changes python -> python2 to fix python when python points to python3, and fixes the bug mentioned in #27)

Changed in wicd:
status: Confirmed → Fix Committed
fredrik (fredrik-obra) wrote :

I'm still having issues with the latest patches:

Importing pynotify failed, notifications disabled.
Has notifications support False
Connecting to daemon...
Can't connect to the daemon, trying to start it automatically...
Wicd daemon is shutting down!
Traceback (most recent call last):
  File "/usr/share/wicd/gtk/wicd-client.py", line 1033, in <module>
  File "/usr/share/wicd/gtk/wicd-client.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/usr/share/wicd/gtk/wicd-client.py", line 1005, in main
    tray_icon = TrayIcon(animate, displaytray=display_app)
  File "/usr/share/wicd/gtk/wicd-client.py", line 139, in __init__
    self.icon_info = self.TrayConnectionInfo(self, self.tr, animate)
  File "/usr/share/wicd/gtk/wicd-client.py", line 201, in __init__
  File "/usr/share/wicd/gtk/wicd-client.py", line 91, in wrapper
    return func(*args, **kwargs)
  File "/usr/share/wicd/gtk/wicd-client.py", line 329, in set_not_connected_state
    self._show_notification(language['disconnected'], None, 'stop')
  File "/usr/share/wicd/gtk/wicd-client.py", line 231, in _show_notification
    self._last_bubble = pynotify.Notification(title, details,
NameError: global name 'pynotify' is not defined

fredrik (fredrik-obra) wrote :

asdf, pasted the wrong output:

2010/11/06 18:08:46 :: Traceback (most recent call last):
2010/11/06 18:08:46 :: File "/usr/share/wicd/daemon/wicd-daemon.py", line 1843, in <module>
2010/11/06 18:08:46 :: main(sys.argv)
2010/11/06 18:08:46 :: File "/usr/share/wicd/daemon/wicd-daemon.py", line 1811, in main
2010/11/06 18:08:46 :: shell=False, close_fds=True).pid
2010/11/06 18:08:46 :: File "/usr/lib/python2.7/subprocess.py", line 672, in __init__
2010/11/06 18:08:46 :: errread, errwrite)
2010/11/06 18:08:46 :: File "/usr/lib/python2.7/subprocess.py", line 1201, in _execute_child
2010/11/06 18:08:46 :: raise child_exception
2010/11/06 18:08:46 :: AttributeError: 'NoneType' object has no attribute 'rfind'

Matthieu Baerts (matttbe) wrote :


I'm Ubuntu Natty and wicd-daemon won't work. I've apply the patch mentioned in #28 (https://code.launchpad.net/~matttbe/wicd/ubuntu_python27 - deb packages available on my ppa)
But I have the same backtrace as fredrik (wicd is version 1.7.0 552):

2010/12/11 01:06:30 :: Traceback (most recent call last):
2010/12/11 01:06:30 :: File "/usr/share/wicd/daemon/wicd-daemon.py", line 1843, in <module>
2010/12/11 01:06:30 :: main(sys.argv)
2010/12/11 01:06:30 :: File "/usr/share/wicd/daemon/wicd-daemon.py", line 1811, in main
2010/12/11 01:06:30 :: shell=False, close_fds=True).pid
2010/12/11 01:06:30 :: File "/usr/lib/python2.7/subprocess.py", line 672, in __init__
2010/12/11 01:06:30 :: errread, errwrite)
2010/12/11 01:06:30 :: File "/usr/lib/python2.7/subprocess.py", line 1202, in _execute_child
2010/12/11 01:06:30 :: raise child_exception
2010/12/11 01:06:30 :: AttributeError: 'NoneType' object has no attribute 'rfind'

Should I open a new bug report?

Adam Blackburn (adamblackburn) wrote :

Do you have a python2 link/binary on your system?

Matthieu Baerts (matttbe) wrote :

No, I only have these binaries:
python python2.6-config python2.7-config python-mkdebian
python2.6 python2.7 python-config

   $ locate python |grep python2$

Adam Blackburn (adamblackburn) wrote :

ok, in the patch you linked to, change the python2 reference (at the very bottom of the patch) to python2.7 or python2.6 and that should fix it. We were debating about what to do about that in the IRC channel the other day. It seems impractical to scan PATH for python2.7 then 2.6 then 2.5 but I think that's what we're going to have to do as it seems that there is not a uniform way of accessing python2 across distros.

Matthieu Baerts (matttbe) wrote :

Oh, you're right! I don't know why I didn't see that :)
I've replaced "python2" by "python" because the interpreter of python 3 is called as "python3"

Matthieu Baerts (matttbe) wrote :

I've proposed my branch for merging into lp:ubuntu/wicd because it can be a annoying bug for those who don't know how to use wpa_supplicant (or for those who can't read its manual ;) )

Thank you for your help!

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package wicd - 1.7.0+ds1-5ubuntu1

wicd (1.7.0+ds1-5ubuntu1) natty; urgency=low

  * debian/patches/
   - Added 31-deepcopy+python27-fixes.patch for python 2.7
     (credit to Archlinux and Remy Oudompheng - LP: #602825)
 -- Matthieu Baerts (matttbe) <email address hidden> Sat, 11 Dec 2010 15:33:10 +0200

Changed in wicd (Ubuntu):
status: New → Fix Released
Adam Blackburn (adamblackburn) wrote :

Matthieu Baerts: what exactly does your branch fix (something about wpa_supplicant?), and does it fix something that would be good to have upstream? I'd be happy to merge it with our stuff as well, if you'd like.

Matthieu Baerts (matttbe) wrote :

@ Adam: I've just applied a patch which is a mix between the revisions 561 (without the modification in wicd/wicd-daemon.py, have a look at the comment #35) and 564 from lp:wicd
So it was a fix for python 2.7 and it's already in trunk!

David Paleino (dpaleino) on 2011-02-15
Changed in wicd:
milestone: none → 1.7.1
Roger Smith (roger-smith) wrote :

Just installed openSUSE 11.4 and while trying to install wicd get "nothing provides python(abi) = 2.6 needed by wicd-1.7.0-7.2.i586"

Whether this is specifically connected with the above problem or not I don't know but 11.4 is using Python 2.7.

gianni (gbarberi) wrote :

still receiving this error log after upgrading to ubuntu 11.04 NN

gianni (gbarberi) wrote :


I searched for wicd, found that it's a python script invoqued by  /usr/bin/python,( if I remember well, I'm not on this machine now).

so I changed to  /usr/bin/python2.6: it is working but it's not a definitive solution.

Stefano Rivera (stefanor) wrote :

gianni: Which version of wicd do you have installed? This should have been fixed in natty ages ago.

gianni (gbarberi) wrote :

i cant check now, but since I made the upgrade, at least is a bug of the

more later

On Mon, Apr 18, 2011 at 10:34 PM, Stefano Rivera <email address hidden>wrote:

> gianni: Which version of wicd do you have installed? This should have
> been fixed in natty ages ago.
> --
> You received this bug notification because you are a direct subscriber
> of the bug.
> https://bugs.launchpad.net/bugs/602825
> Title:
> wicd doesnt like python 2.7
> To unsubscribe from this bug, go to:
> https://bugs.launchpad.net/wicd/+bug/602825/+subscribe

gianni (gbarberi) wrote :


With upgrade to NN final the bug is fixed.

/usr/sbin/wicd has this line:

exec /usr/bin/python -O /usr/share/wicd/daemon/wicd-daemon.py $@

biff (helvile) on 2011-06-06
Changed in wicd (Ubuntu):
assignee: nobody → biff (helvile)
David Paleino (dpaleino) on 2011-09-16
Changed in wicd:
assignee: nobody → David Paleino (dpaleino)
David Paleino (dpaleino) on 2012-02-05
Changed in wicd:
status: Fix Committed → Fix Released

Fixed upstream.
Fixed PLD package: wicd-1.7.1-1.src.rpm

Changed in pld-linux:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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