I realize this is a Windows limitation and I'm not entirely sure how you might go about solving it, but I'm running into the 260 char file path limit when trying to save files with deep folder structures and/or long filenames.
Changing 'backup_dir' to something shorter is helpful, and I've read about registry tweaks and group policy changes to enable Win32 long paths, but perhaps there's a programmatic solution for working around the char limit?
Edit: missing word