m4lf0rm3d / GSpace

GSpace is an efficient and unified solution for synchronizing files across multiple devices using the power of Google Drive APIs. While Google Drive offers a desktop application for file synchronization, GSpace extends this capability to Android and Linux platforms, providing a seamless experience for users across diverse environments.
MIT License
1 stars 2 forks source link

Invalid Filenames #2

Open Programmer-Dr opened 2 months ago

Programmer-Dr commented 2 months ago

If the names of folders or files to be synchronized contains invalid characters, it will throw an error.

tarting pulling changes from Google Drive: Traceback (most recent call last): File "D:\GSpace\GSpace.py", line 267, in <module> main() File "D:\GSpace\GSpace.py", line 264, in main raise e File "D:\GSpace\GSpace.py", line 254, in main options[sys.argv[1]]() File "D:\GSpace\GSpace.py", line 228, in sync raise e File "D:\GSpace\GSpace.py", line 217, in sync self.pull() File "D:\GSpace\GSpace.py", line 145, in pull raise e File "D:\GSpace\GSpace.py", line 113, in pull self.gdrive.download_helper(to_download[0], to_download[1], to_download[2]) File "D:\GSpace\GoogleDriveHelper.py", line 285, in download_helper raise e File "D:\GSpace\GoogleDriveHelper.py", line 277, in download_helper self.download_file(output_path, drive_folder_id) if not isDir else self.download_folder(output_path, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "D:\GSpace\GoogleDriveHelper.py", line 273, in download_folder raise e File "D:\GSpace\GoogleDriveHelper.py", line 252, in download_folder os.makedirs(ConfigurationManager.LOCAL_FILESYSTEM_FOLDER_PATH + output_path, exist_ok=True) File "<frozen os>", line 225, in makedirs OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'D:\\temp2onone\\fundamental/dsfsa | sfwu ee | erge'

m4lf0rm3d commented 2 months ago

Hi there,

Thank you for reporting this issue. From the error message, it looks like the problem is related to invalid characters in the file or folder names that are not supported by the Windows file system.

To help me address this bug more effectively, could you please provide the exact name of the file or folder that caused this error? Knowing the specific name will allow me to better reproduce and diagnose the issue.

Looking forward to your response!

Best regards, Ahsan Azeemi

Programmer-Dr commented 2 months ago

File "", line 225, in makedirs OSError: [WinError 123] The filename, directory name, or volume label syntax is incorrect: 'D:\temp2onone\fundamental/dsfsa | sfwu ee | erge'

Hi, for my particular case it is the pipe character. this folder dsfsa | sfwu ee | erge is just a dummy example which I created for debugging. my sync folder contains many files and folders with the pipe character in their names. The code works fine in Linux, but switching to Windows causes a lot of problems. I'm trying to modify the code to satisfy my needs which is to either replace the invalid characters with the corresponding Unicode or remove them all together with slugify library and keeping track of modifications in a log file for each/main folder. Thanks for your quick response.

m4lf0rm3d commented 1 month ago

Can you please create a PR if you have fixed it?