I was trying to process some data in a GitHub action.
However, due to a Japanese file name, I can not read the file successfully by:
pd.read_csv('C:\\202204_10エリア計.csv')
And I was trying to rename it before read it by:
for filename in os.listdir(download_path):
if filename.startswith('202204'):
filename = filename.encode('utf-8').decode(locale.getpreferredencoding(False))
print(filename) # this print '202204_10エリア計.csv' on github action
os.rename(os.path.join(download_path, filename), os.path.join(download_path, '202204.csv')
But it gets error:
[WinError 2] The system cannot find the file specified: 'C:\\202204_10エリア計.csv' -> 'C:\\202204.csv'