Skip to content

Conversation

@solanav
Copy link

@solanav solanav commented Mar 25, 2021

There was an error when downloading text files on f.write(res.data) in webdav.py:

TypeError: a bytes-like object is required, not 'str'

I also added a two new parameters to this function:

  • download_path (str): to specify where you want to download the file instead of assuming "./"
  • overwrite (bool): to choose if you want to overwrite files or you want to raise an exception on duplicate files.

@solanav solanav changed the title Fix and modification of download_file" Fix and modification of "download_file" Mar 25, 2021
Filenames are URL-encoded, so we should preserve the original filename when saving them.
@scrutinizer-notifier
Copy link

The inspection completed: 1 new issues, 1 updated code elements

@luffah
Copy link

luffah commented May 5, 2021

( If you still have the test case, i ll be grateful if you test with my repo — refactored code and python2 compat — : https://github.com/luffah/nextcloud-API )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants