Add support for folder paths longer than 255 characters (Windows)

master
Dan Howe 6 years ago
parent a61ae3be85
commit 1e27a4d77f

@ -77,7 +77,12 @@ def get_document_list(mod_id, output_dir):
# Create modification folder # Create modification folder
mod_dir = os.path.join(output_dir, project_name, mod_name) mod_dir = os.path.join(output_dir, project_name, mod_name)
os.makedirs(mod_dir, exist_ok=True) try:
os.makedirs(mod_dir, exist_ok=True)
except FileNotFoundError:
# Fix destination path if longer than 255 characters (Windows only)
mod_dir = '\\\\?\\' + os.path.abspath(mod_dir)
os.makedirs(mod_dir, exist_ok=True)
# Add note if no documents are found on portal # Add note if no documents are found on portal
if not folders: if not folders:

Loading…
Cancel
Save