Export to GitHub

pylockfile - issue #33

wrapper functions break inheritance


Posted on Sep 27, 2013 by Happy Camel

you're very probably aware, but python-daemon inherits from LinkFileLock, which doesn't work with the new wrapper functions of course.

What steps will reproduce the problem? >>> import lockfile >>> class bla(lockfile.LinkFileLock): ... pass

What is the expected output? What do you see instead?

TypeError: Error when calling the metaclass bases function() argument 1 must be code, not str

What version of the product are you using? On what operating system?

0.9 Ubuntu/Centos

Please provide any additional information below.

Comment #1

Posted on Feb 18, 2014 by Happy Dog

Yeah, metaclasses.

And I only wanted to convert a simple reference implementation (name python-daemon) to py3k …

If things were so simple.

Comment #2

Posted on Feb 18, 2014 by Happy Dog

By the way, this is was Python 3 has to say about this:

File "/usr/lib64/python3.3/unittest/loader.py", line 96, in loadTestsFromName module = import('.'.join(parts_copy)) File "/home/philip/code/python-daemon-1.5.5/test/test_daemon.py", line 35, in from test.test_pidlockfile import ( File "./test/test_pidlockfile.py", line 30, in from daemon import pidlockfile File "./daemon/pidlockfile.py", line 36, in class PIDLockFile(LinkFileLock, object): TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

Status: New

Labels:
Type-Defect Priority-Medium