﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
17686	file.save crashes on unicode filename	sylvain.lebon@…	Florian Demmer	"I try to add a file into a FileField of one of my object.
The problem is I get a file with a unicode name with special characters.

I have
{{{name = (u'l\u2019\xe9cran.png').encode(""utf-8"")}}}

now if I do 
{{{str1 = ""%s%s""(MEDIA_ROOT, name)}}}

I have
{{{'/home/oi/OIFS/Capture d\xe2\x80\x99\xc3\xa9cran 2012-01-24 \xc3\xa0 14.58.48.png'}}}

and os.stat(str1) passes.

but with 
{{{str2 = safe_join(MEDIA_ROOT, name)}}}

str is then 
{{{u'/home/oi/OIFS/Capture d\u2019\xe9cran 2012-01-24 \xe0 14.58.48.png'}}}

and os.stat fails.

The thing is file.save(name, content, False) uses safe_join and then os.stat.

Now I'm not sure if I should get the name in a different encoding but I don't seem to manage to get it right.

Thanks"	Cleanup/optimization	closed	Documentation	dev	Normal	fixed		Simon Charette lrekucki@…	Accepted	1	0	0	0	0	0
