Re: [Django] #11994: save upload file with specify encode

2010-03-02 Thread Django
#11994: save upload file with specify encode
---+
  Reporter:  flyinfl...@gmail.com  | Owner:  flyinflash
Status:  closed| Milestone:
 Component:  File uploads/storage  |   Version:  1.2-alpha 
Resolution:  fixed |  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  1 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by kmtracey):

  * status:  assigned => closed
  * resolution:  => fixed

Comment:

 I suspect this is fixed by r12661, which restores old behavior of passing
 unicode file names to the OS for saving.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #11994: save upload file with specify encode

2010-02-23 Thread Django
#11994: save upload file with specify encode
---+
  Reporter:  flyinfl...@gmail.com  | Owner:  flyinflash
Status:  assigned  | Milestone:
 Component:  File uploads/storage  |   Version:  1.2-alpha 
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  1 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by ubernostrum):

  * milestone:  1.2 =>

Comment:

 1.2 is feature-frozen, moving this feature request off the milestone.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #11994: save upload file with specify encode

2010-02-22 Thread Django
#11994: save upload file with specify encode
---+
  Reporter:  flyinfl...@gmail.com  | Owner:  flyinflash
Status:  assigned  | Milestone:  1.2   
 Component:  File uploads/storage  |   Version:  1.2-alpha 
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  1 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Comment (by peterbe):

 Unable to reproduce this.

 In pure Python, if you try to do something like this:
 {{{
 os.path.join('uploads', '中文'.encode('utf8'), filename)
 }}}
 You'll get an UnicodeDecodeError error if {{{filename}}} is a Unicode
 string and not a byte string so perhaps the ticker reporter got a
 {{{UnicodeDecodeError}}} in his implementation of {{{get_path()}}} and not
 inside Django.

 I was able to write a {{{FileField}}} that looked something like this:

 {{{
 def get_path(instance, filename):
 return os.path.join(u'中文'.encode('utf8'), filename.encode('utf8'))
 class Thing(models.Model):
 name = models.CharField(max_length=64)
 thing_file = models.FileField(upload_to=get_path)
 }}}

 That worked fine. I also tried with my own storage class. A very basic one
 that just stores the file in /tmp and it worked perfectly fine. In other
 words could not reproduce any bugs in Django.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.



Re: [Django] #11994: save upload file with specify encode

2010-01-15 Thread Django
#11994: save upload file with specify encode
---+
  Reporter:  flyinfl...@gmail.com  | Owner:  flyinflash
Status:  assigned  | Milestone:  1.2   
 Component:  File uploads/storage  |   Version:  1.2-alpha 
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  1 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by flyinflash):

  * version:  1.1 => 1.2-alpha

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.




Re: [Django] #11994: save upload file with specify encode

2009-12-26 Thread Django
#11994: save upload file with specify encode
---+
  Reporter:  flyinfl...@gmail.com  | Owner:  flyinflash
Status:  assigned  | Milestone:  1.2   
 Component:  File uploads/storage  |   Version:  1.1   
Resolution:|  Keywords:
 Stage:  Accepted  | Has_patch:  0 
Needs_docs:  1 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by flyinflash):

  * stage:  Unreviewed => Accepted

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.




Re: [Django] #11994: save upload file with specify encode

2009-12-26 Thread Django
#11994: save upload file with specify encode
---+
  Reporter:  flyinfl...@gmail.com  | Owner:  flyinflash
Status:  assigned  | Milestone:  1.2   
 Component:  File uploads/storage  |   Version:  1.1   
Resolution:|  Keywords:
 Stage:  Unreviewed| Has_patch:  0 
Needs_docs:  1 |   Needs_tests:  0 
Needs_better_patch:  0 |  
---+
Changes (by flyinflash):

  * status:  new => assigned
  * needs_better_patch:  => 0
  * needs_tests:  => 0
  * milestone:  => 1.2
  * owner:  nobody => flyinflash
  * needs_docs:  => 1

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.

--

You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.




[Django] #11994: save upload file with specify encode

2009-10-07 Thread Django
#11994: save upload file with specify encode
--+-
 Reporter:  flyinfl...@gmail.com  |   Owner:  nobody
   Status:  new   |   Milestone:
Component:  File uploads/storage  | Version:  1.1   
 Keywords:|   Stage:  Unreviewed
Has_patch:  0 |  
--+-
 {{{
 # -*- coding: utf-8 -*-
 # in models.py
 def get_path(instance, filename):
 path = osp.join('uploads', '中文'.encode('utf8'), filename)
 return path
 class Files(models.Model):
 name = models.CharField(max_length=64)
 files = models.FileField(upload_to=get_path, storage=MyStorage)
 }}}

 Upload file with above code on Chinese version MS-Windows, it will get
 strange filename which contains unreadable characters.

 I guess this problem associated with Chinese version MS-Windows using GBK
 encoding by default.
 After read debug a long time and has read
 http://docs.djangoproject.com/en/dev/howto/custom-file-storage/, I think
 use custom storage which could specify save file with specify encode, such
 as GBK could fix my problem.

 Django is a very very very good Web framework, I hope developers could add
 this feature, and please don't try to restrict user or down stream
 developers, thanks.

-- 
Ticket URL: 
Django 
The Web framework for perfectionists with deadlines.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~--~~~~--~~--~--~---