Skip to content
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
4 changes: 2 additions & 2 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', '3.11', '3.12', '3.13', pypy-3.8, pypy-3.9, pypy-3.10]
python-version: [3.8, 3.9, '3.10', '3.11', '3.12', '3.13', pypy-3.8, pypy-3.9, pypy-3.10]

steps:
- uses: actions/checkout@v4
Expand All @@ -31,7 +31,7 @@ jobs:
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
flake8 . --count --select=E9,F63,F7,F82 --ignore=F824 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Test with unittest
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ $ you-get https://github.com/soimort/you-get/archive/master.zip
In order to get the latest ```develop``` branch without messing up the PIP, you can try:

```
$ pip install --upgrade git+https://github.com/soimort/you-get@develop
$ pip install --upgrade --force-reinstall git+https://github.com/soimort/you-get@develop
```

## Getting Started
Expand Down
7 changes: 5 additions & 2 deletions src/you_get/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -807,6 +807,8 @@ def numreturn(a):
except socket.timeout:
pass
if not buffer:
if file_size == float('+inf'): # Prevent infinite downloading
break
if is_chunked and received_chunk == range_length:
break
elif not is_chunked and received == file_size: # Download finished
Expand All @@ -827,9 +829,10 @@ def numreturn(a):
received, os.path.getsize(temp_filepath), temp_filepath
)

if os.access(filepath, os.W_OK):
if os.access(filepath, os.W_OK) and file_size != float('inf'):
# on Windows rename could fail if destination filepath exists
os.remove(filepath)
# we should simply choose a new name instead of brutal os.remove(filepath)
filepath = filepath + " (2)"
os.rename(temp_filepath, filepath)


Expand Down
Loading