Skip to content

Commit

Permalink
BUG: Use shutil.move for cross-device file renaming (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
junlysky authored Jun 5, 2024
1 parent c4dc6bf commit 14937fd
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions HinetPy/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from datetime import datetime, timedelta
from html.parser import HTMLParser
from multiprocessing.pool import ThreadPool
import shutil

import requests
from requests.adapters import HTTPAdapter
Expand Down Expand Up @@ -524,8 +525,7 @@ def get_continuous_waveform( # noqa: PLR0915, PLR0912
ctable = os.path.join(dirname, ctable)
if dirname and not os.path.exists(dirname):
os.makedirs(dirname, exist_ok=True)
os.rename(ch_euc, ctable)

shutil.move(ch_euc, ctable)
# 4. cleanup
if cleanup:
for cnt in cnts:
Expand Down

0 comments on commit 14937fd

Please sign in to comment.