Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor simplitication with http response decoding #930

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -519,9 +519,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