duplicity-talk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Duplicity-talk] Does duplicity rely on a special namespace abbrevia


From: edgar . soldin
Subject: Re: [Duplicity-talk] Does duplicity rely on a special namespace abbreviation in webdav respones?
Date: Wed, 27 Jul 2022 19:46:14 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 27.07.2022 19:17, edgar.soldin@web.de wrote:
On 27.07.2022 17:59, Kenneth Loafman via Duplicity-talk wrote:
I don't have the spec for WebDAV, but I'm guessing that your addition to duplicity 
will do no harm.  Perhaps you could submit a bug request with the fix to issues 
<https://gitlab.com/duplicity/duplicity/-/issues> so we can track it.

...Thanks,
...Ken


On Wed, Jul 27, 2022 at 6:22 AM Felix Prüter via Duplicity-talk 
<duplicity-talk@nongnu.org <mailto:duplicity-talk@nongnu.org>> wrote:

    Hi ede,
    thanks for your fast reply!

    Am 2022-07-19 12:11, schrieb edgar.soldin--- via Duplicity-talk:
    duplicity is outdated and  not maintained any more. please upgrade to 
latest 0.8.23 and see if the error persists.

    1) I know that the 0.7-series is EOL but my hoster still use it :-(
    2) The error persits even with the newest version

    Does the webdav backend require a "d" as abbreviation for the xml namespace 
and does not parse the xml response otherwise?

    can't tell, but feel free to have a look in

    
https://gitlab.com/duplicity/duplicity/-/blob/main/duplicity/backends/webdavbackend.py
 
<https://gitlab.com/duplicity/duplicity/-/blob/main/duplicity/backends/webdavbackend.py>

    My assumption seems to be correct: in the webdavbackend.py in line 349

    for href in dom.getElementsByTagName(u'd:href') + 
dom.getElementsByTagName(u'D:href'):

    Adding an additional dom.getElementsByTagName(u'ns0:href') to that line 
solves the problem!

    Question: is it conceivable that the namespace prefix gets configurable 
within duplicity?
    Or should that issue ("wrong" namespace prefix: ns0 instead of d/D) be 
solved on the backend's side?

quick search
  spec - http://www.webdav.org/specs/rfc4918.xml#METHOD_PROPFIND
  example - 
https://github.com/laurent22/joplin/commit/01614b5a136cab669e961ef4d1b95c3738afad6a
suggests that the namespace(s) should be parsed from the response and used 
accordingly.

surely that'd be the cleaner solution.

..ede


this looks promising, just ignore the namespace.
 
https://stackoverflow.com/questions/2528852/how-do-i-get-minidom-to-ignore-namespaces

the backends "tastes" the hrefs anyway in 
https://gitlab.com/duplicity/duplicity/-/blob/main/duplicity/backends/webdavbackend.py#L350
 so it should be safe to simply check out all `href`s given in the response.

Felix, would you mind to try that solution? ..ede/duply.net



reply via email to

[Prev in Thread] Current Thread [Next in Thread]