Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid Filenames #2

Open
Programmer-Dr opened this issue May 9, 2024 · 3 comments
Open

Invalid Filenames #2

Programmer-Dr opened this issue May 9, 2024 · 3 comments

Comments

@Programmer-Dr
Copy link

Programmer-Dr commented May 9, 2024

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'

@Programmer-Dr Programmer-Dr changed the title Invalid ilenames Invalid Filenames May 9, 2024
@m4lf0rm3d
Copy link
Owner

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

@m4lf0rm3d m4lf0rm3d pinned this issue May 9, 2024
@Programmer-Dr
Copy link
Author

Programmer-Dr commented May 13, 2024

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
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants