Skip to content

Commit

Permalink
fix: cache file write error on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
lihsai0 committed Sep 30, 2024
1 parent d8ed878 commit 5008fe0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ jobs:
fail-fast: false
max-parallel: 1
matrix:
os: ['ubuntu-20.04', 'windows-2019']
python_version: ['2.7', '3.4', '3.5', '3.6', '3.7', '3.8', '3.9']
runs-on: ubuntu-20.04
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v2
Expand Down
3 changes: 2 additions & 1 deletion qiniu/http/regions_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import logging
import tempfile
import os
import shutil

from qiniu.compat import json, b as to_bytes
from qiniu.utils import io_md5
Expand Down Expand Up @@ -655,7 +656,7 @@ def __shrink_cache(self):
)

# rename file
os.rename(shrink_file_path, self._cache_scope.persist_path)
shutil.move(shrink_file_path, self._cache_scope.persist_path)
except FileAlreadyLocked:
pass
finally:
Expand Down

0 comments on commit 5008fe0

Please sign in to comment.