Sanitizing filename strings across platforms

2011-05-31 Thread Tim Chase
Scenario: a file-name from potentially untrusted sources may have odd filenames that need to be sanitized for the underlying OS. On *nix, this generally just means don't use '/' or \x00 in your string, while on Win32, there are a host of verboten characters and file-names. Then there's also

Re: Sanitizing filename strings across platforms

2011-05-31 Thread Jean-Paul Calderone
On May 31, 10:17 pm, Tim Chase python.l...@tim.thechases.com wrote: Scenario: a file-name from potentially untrusted sources may have odd filenames that need to be sanitized for the underlying OS. On *nix, this generally just means don't use '/' or \x00 in your string, while on Win32, there