Menu

Error when locking (Python 2.6)

Blackwell
2008-12-18
2013-01-25
  • Blackwell

    Blackwell - 2008-12-18

    Hello everyone.

    The following code for uploading a file...

    ###
    import webdav.WebdavClient

    c = webdav.WebdavClient.ResourceStorer("https://webdav.smartdrive.web.de/test.txt")
    c.connection.addBasicAuthorization("foo", "bar", "")
    #c.move("https://webdav.smartdrive.web.de/test1.txt")

    f = open("davtest.py", "r")
    lock = c.lock("myLock")
    f.close()
    c.uploadFile(f)
    c.unlock(lock)
    ###

    ...results in this error message:

    ###
    Commandline: C:\Programme\Python26\python.exe "C:\Dokumente und Einstellungen\clackwell\Desktop\Python_WebDAV_Library-0.1.2\davtest2.py"
    Workingdirectory: C:\Dokumente und Einstellungen\clackwell\Desktop\Python_WebDAV_Library-0.1.2
    Timeout: 10000 ms

    C:\Dokumente und Einstellungen\clackwell\Desktop\Python_WebDAV_Library-0.1.2\webdav\Connection.py:26: DeprecationWarning: the md5 module is deprecated; use hashlib instead
      import md5
    Traceback (most recent call last):
      File "C:\Dokumente und Einstellungen\clackwell\Desktop\Python_WebDAV_Library-0.1.2\davtest2.py", line 9, in <module>
        lock = c.lock("clackwell")
      File "C:\Dokumente und Einstellungen\clackwell\Desktop\Python_WebDAV_Library-0.1.2\webdav\WebdavClient.py", line 266, in lock
        response = self.connection.lock(self.path, owner)
    TypeError: '_RLock' object is not callable

    Process "Python Interpreter" terminated, ExitCode: 00000001
    ###

    Is this a wrong way to use this library? Or  is this a bug or a Python 2.6 incompatibility?

    With best regards

    Clemens Anhuth

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.