@@ -150,11 +150,11 @@ class Discover:
150150 _homeset_tag = None
151151 _well_known_uri = None
152152 _collection_xml = b"""
153- <d: propfind xmlns:d ="DAV:">
154- <d: prop>
155- <d: resourcetype />
156- </d: prop>
157- </d: propfind>
153+ <propfind xmlns="DAV:">
154+ <prop>
155+ <resourcetype />
156+ </prop>
157+ </propfind>
158158 """
159159
160160 def __init__ (self , session , kwargs ):
@@ -180,11 +180,11 @@ def _find_principal_impl(self, url):
180180 headers = self .session .get_default_headers ()
181181 headers ['Depth' ] = '0'
182182 body = b"""
183- <d: propfind xmlns:d ="DAV:">
184- <d: prop>
185- <d: current-user-principal />
186- </d: prop>
187- </d: propfind>
183+ <propfind xmlns="DAV:">
184+ <prop>
185+ <current-user-principal />
186+ </prop>
187+ </propfind>
188188 """
189189
190190 response = self .session .request ('PROPFIND' , url , headers = headers ,
@@ -300,16 +300,16 @@ def create(self, collection):
300300
301301 def _create_collection_impl (self , url ):
302302 data = '''<?xml version="1.0" encoding="utf-8" ?>
303- <D: mkcol xmlns:D ="DAV:">
304- <D: set>
305- <D: prop>
306- <D: resourcetype>
307- <D: collection/>
303+ <mkcol xmlns="DAV:">
304+ <set>
305+ <prop>
306+ <resourcetype>
307+ <collection/>
308308 {}
309- </D: resourcetype>
310- </D: prop>
311- </D: set>
312- </D: mkcol>
309+ </resourcetype>
310+ </prop>
311+ </set>
312+ </mkcol>
313313 ''' .format (
314314 etree .tostring (etree .Element (self ._resourcetype ),
315315 encoding = 'unicode' )
@@ -328,11 +328,11 @@ class CalDiscover(Discover):
328328 _namespace = 'urn:ietf:params:xml:ns:caldav'
329329 _resourcetype = '{%s}calendar' % _namespace
330330 _homeset_xml = b"""
331- <d: propfind xmlns:d ="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
332- <d: prop>
331+ <propfind xmlns="DAV:" xmlns:c="urn:ietf:params:xml:ns:caldav">
332+ <prop>
333333 <c:calendar-home-set />
334- </d: prop>
335- </d: propfind>
334+ </prop>
335+ </propfind>
336336 """
337337 _homeset_tag = '{%s}calendar-home-set' % _namespace
338338 _well_known_uri = '/.well-known/caldav'
@@ -342,11 +342,11 @@ class CardDiscover(Discover):
342342 _namespace = 'urn:ietf:params:xml:ns:carddav'
343343 _resourcetype = '{%s}addressbook' % _namespace
344344 _homeset_xml = b"""
345- <d: propfind xmlns:d ="DAV:" xmlns:c="urn:ietf:params:xml:ns:carddav">
346- <d: prop>
345+ <propfind xmlns="DAV:" xmlns:c="urn:ietf:params:xml:ns:carddav">
346+ <prop>
347347 <c:addressbook-home-set />
348- </d: prop>
349- </d: propfind>
348+ </prop>
349+ </propfind>
350350 """
351351 _homeset_tag = '{%s}addressbook-home-set' % _namespace
352352 _well_known_uri = '/.well-known/carddav'
@@ -463,7 +463,7 @@ def get_multi(self, hrefs):
463463 for href in hrefs :
464464 if href != self ._normalize_href (href ):
465465 raise exceptions .NotFoundError (href )
466- href_xml .append (f'<D: href>{ href } </D: href>' )
466+ href_xml .append (f'<href>{ href } </href>' )
467467 if not href_xml :
468468 return ()
469469
@@ -620,13 +620,13 @@ def list(self):
620620 headers ['Depth' ] = '1'
621621
622622 data = b'''<?xml version="1.0" encoding="utf-8" ?>
623- <D: propfind xmlns:D ="DAV:">
624- <D: prop>
625- <D: resourcetype/>
626- <D: getcontenttype/>
627- <D: getetag/>
628- </D: prop>
629- </D: propfind>
623+ <propfind xmlns="DAV:">
624+ <prop>
625+ <resourcetype/>
626+ <getcontenttype/>
627+ <getetag/>
628+ </prop>
629+ </propfind>
630630 '''
631631
632632 # We use a PROPFIND request instead of addressbook-query due to issues
@@ -647,11 +647,11 @@ def get_meta(self, key):
647647
648648 xpath = f'{{{ namespace } }}{ tagname } '
649649 data = '''<?xml version="1.0" encoding="utf-8" ?>
650- <D: propfind xmlns:D ="DAV:">
651- <D: prop>
650+ <propfind xmlns="DAV:">
651+ <prop>
652652 {}
653- </D: prop>
654- </D: propfind>
653+ </prop>
654+ </propfind>
655655 ''' .format (
656656 etree .tostring (etree .Element (xpath ), encoding = 'unicode' )
657657 ).encode ('utf-8' )
@@ -683,13 +683,13 @@ def set_meta(self, key, value):
683683 element .text = normalize_meta_value (value )
684684
685685 data = '''<?xml version="1.0" encoding="utf-8" ?>
686- <D: propertyupdate xmlns:D ="DAV:">
687- <D: set>
688- <D: prop>
686+ <propertyupdate xmlns="DAV:">
687+ <set>
688+ <prop>
689689 {}
690- </D: prop>
691- </D: set>
692- </D: propertyupdate>
690+ </prop>
691+ </set>
692+ </propertyupdate>
693693 ''' .format (etree .tostring (element , encoding = 'unicode' )).encode ('utf-8' )
694694
695695 self .session .request (
@@ -714,12 +714,12 @@ class CalDAVStorage(DAVStorage):
714714 end_date = None
715715
716716 get_multi_template = '''<?xml version="1.0" encoding="utf-8" ?>
717- <C:calendar-multiget xmlns:D ="DAV:"
717+ <C:calendar-multiget xmlns="DAV:"
718718 xmlns:C="urn:ietf:params:xml:ns:caldav">
719- <D: prop>
720- <D: getetag/>
719+ <prop>
720+ <getetag/>
721721 <C:calendar-data/>
722- </D: prop>
722+ </prop>
723723 {hrefs}
724724 </C:calendar-multiget>'''
725725
@@ -796,12 +796,12 @@ def list(self):
796796 yield from DAVStorage .list (self )
797797
798798 data = '''<?xml version="1.0" encoding="utf-8" ?>
799- <C:calendar-query xmlns:D ="DAV:"
799+ <C:calendar-query xmlns="DAV:"
800800 xmlns:C="urn:ietf:params:xml:ns:caldav">
801- <D: prop>
802- <D: getcontenttype/>
803- <D: getetag/>
804- </D: prop>
801+ <prop>
802+ <getcontenttype/>
803+ <getetag/>
804+ </prop>
805805 <C:filter>
806806 {caldavfilter}
807807 </C:filter>
@@ -833,12 +833,12 @@ class CardDAVStorage(DAVStorage):
833833 discovery_class = CardDiscover
834834
835835 get_multi_template = '''<?xml version="1.0" encoding="utf-8" ?>
836- <C:addressbook-multiget xmlns:D ="DAV:"
836+ <C:addressbook-multiget xmlns="DAV:"
837837 xmlns:C="urn:ietf:params:xml:ns:carddav">
838- <D: prop>
839- <D: getetag/>
838+ <prop>
839+ <getetag/>
840840 <C:address-data/>
841- </D: prop>
841+ </prop>
842842 {hrefs}
843843 </C:addressbook-multiget>'''
844844
0 commit comments