From 50e27dfdafaa42481f5024df3a40da98361dfd58 Mon Sep 17 00:00:00 2001 From: junlysky Date: Wed, 5 Jun 2024 17:30:47 +0800 Subject: [PATCH 1/2] Fix a small bug and update client.py Fix a small bug:OSError: [Errno 18] Invalid cross-device link. os.rename only works if source and destination are on the same file system. Use shutil.move instead. --- HinetPy/client.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/HinetPy/client.py b/HinetPy/client.py index 4876226a..32912010 100644 --- a/HinetPy/client.py +++ b/HinetPy/client.py @@ -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 @@ -524,8 +525,8 @@ 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) - + #os.rename(ch_euc, ctable) + shutil.move(ch_euc, ctable) # 4. cleanup if cleanup: for cnt in cnts: From 01deb1fc7ec83178c22c722908a02ed93ae6fb56 Mon Sep 17 00:00:00 2001 From: Dongdong Tian Date: Wed, 5 Jun 2024 18:13:22 +0800 Subject: [PATCH 2/2] Update HinetPy/client.py --- HinetPy/client.py | 1 - 1 file changed, 1 deletion(-) diff --git a/HinetPy/client.py b/HinetPy/client.py index 32912010..31f0d107 100644 --- a/HinetPy/client.py +++ b/HinetPy/client.py @@ -525,7 +525,6 @@ 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: