dvshnt / django-photologue

Automatically exported from code.google.com/p/django-photologue
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Unusual Filenames Error #127

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Upload a picture with characters like "áéñçãó" or anything like that in
the filename.

What is the expected output? What do you see instead?
Unicode Error @ line 302 in function _get_filename_for_size of models.py

What version of the product are you using? On what operating system?
VERSION = (2, 1)

Please provide any additional information below.
I fixed with the code below.
    def _get_filename_for_size(self, size):
        size = getattr(size, 'name', size)
        base, ext = os.path.splitext(self.image_filename())
        base = unicode(base, 'utf-8')
        ext = unicode(ext, 'utf-8')
        sep = unicode('_', 'utf-8')
        return ''.join([base, sep, size, ext])

Original issue reported on code.google.com by dtambore...@gmail.com on 11 Aug 2009 at 8:27

GoogleCodeExporter commented 8 years ago
We came across this problem in Cloud27 earlier this year. I thought I had done 
something about it, but I guess I 
didn't come upstream. Here was the fix (also a better fix than one proposed 
here)

http://code.pinaxproject.com/paste/nVff/

Original comment by bros...@gmail.com on 12 Aug 2009 at 11:12

GoogleCodeExporter commented 8 years ago
This issue was closed by revision r399.

Original comment by justin.d...@gmail.com on 22 Aug 2009 at 12:54

GoogleCodeExporter commented 8 years ago
The link: http://code.pinaxproject.com/paste/nVff/ fixed only part of problem, 
the
proposed one above should be also applied to total fix the problem. I have 
tested
this, only proposed fix being included can totally fix the problem

Original comment by stephenc...@gmail.com on 14 Oct 2009 at 11:37

GoogleCodeExporter commented 8 years ago
I can't test right now, but could you do us a favor and provide the error you 
are getting and how *you* were able 
to reproduce. At the time of fix this was working correctly. I won't put it 
pass me for making a mistake ;-)

Original comment by bros...@gmail.com on 15 Oct 2009 at 12:05

GoogleCodeExporter commented 8 years ago
I'm running into the same issue with Photologue 2.2
I've created a new ticket #157 giving further informations, feel free to 
reopen/merge.

Original comment by andre.mi...@gmail.com on 5 Aug 2010 at 1:23