Martijn Pieters <> added the comment:

I found this issue after helping someone solve a Stack Overflow question at; they eventually figured out that 
their prefix was a path, not a path element.

I'd be all in favour of making tempfile._sanitize_params either reject a prefix 
or suffix with `os.sep` or `os.altsep` characters, or just take the last 
element of os.path.split().

nosy: +mjpieters

Python tracker <>
Python-bugs-list mailing list

Reply via email to