Skip to content

Commit

Permalink
Simplify some response decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
Hugo Osvaldo Barrera committed Aug 18, 2021
1 parent dff48f1 commit 548bece
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion vdirsyncer/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ async def request(

logger.debug(r.status)
logger.debug(r.headers)
logger.debug(r.content)
logger.debug(r.text)

if r.status == 412:
raise exceptions.PreconditionFailed(r.reason)
Expand Down
4 changes: 1 addition & 3 deletions vdirsyncer/storage/dav.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,9 +546,7 @@ async def get_multi(self, hrefs):
response = await self.session.request(
"REPORT", "", data=data, headers=self.session.get_default_headers()
)
root = _parse_xml(
await response.content.read()
) # etree only can handle bytes
root = _parse_xml(await response.content.read())
rv = []
hrefs_left = set(hrefs)
for href, etag, prop in self._parse_prop_responses(root):
Expand Down
2 changes: 1 addition & 1 deletion vdirsyncer/storage/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ async def list(self):
)
self._items = {}

for item in split_collection((await r.read()).decode("utf-8")):
for item in split_collection(await r.text()):
item = Item(item)
if self._ignore_uids:
item = item.with_uid(item.hash)
Expand Down

0 comments on commit 548bece

Please sign in to comment.