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

Fix and modification of "download_file" #63

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

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