Re: [Django] #9586: Shall upload_to return an urlencoded string or not?

10 views
Skip to first unread message

Django

unread,
Nov 11, 2011, 4:24:08 AM11/11/11
to django-...@googlegroups.com
#9586: Shall upload_to return an urlencoded string or not?
-------------------------------------+-------------------------------------
Reporter: eibaan | Owner: nobody
Type: Bug | Status: new
Component: File | Version: 1.0
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Design
Keywords: | decision needed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by anonymous):

* ui_ux: => 0
* easy: => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/9586#comment:6>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 2, 2013, 2:53:43 PM4/2/13
to django-...@googlegroups.com
#9586: Shall upload_to return an urlencoded string or not?
-------------------------------------+-------------------------------------
Reporter: eibaan | Owner: nobody
Type: Bug | Status: new
Component: File | Version: 1.0
uploads/storage | Resolution:
Severity: Normal | Triage Stage: Design
Keywords: | decision needed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by aaugustin):

Yes, the `url` method should apply `iri_to_uri`. (I haven't verified that
the issue is still valid.)

--
Ticket URL: <https://code.djangoproject.com/ticket/9586#comment:7>

Django

unread,
Apr 2, 2013, 2:54:25 PM4/2/13
to django-...@googlegroups.com
#9586: Shall upload_to return an urlencoded string or not?
--------------------------------------+------------------------------------

Reporter: eibaan | Owner: nobody
Type: Bug | Status: new
Component: File uploads/storage | Version: 1.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by aaugustin):

* needs_better_patch: 0 => 1
* has_patch: 0 => 1
* needs_tests: 0 => 1
* easy: 0 => 1
* stage: Design decision needed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/9586#comment:8>

Django

unread,
Jun 30, 2013, 3:25:27 PM6/30/13
to django-...@googlegroups.com
#9586: Shall upload_to return an urlencoded string or not?
--------------------------------------+------------------------------------
Reporter: eibaan | Owner: susan
Type: Bug | Status: assigned

Component: File uploads/storage | Version: 1.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by susan):

* status: new => assigned
* owner: nobody => susan


--
Ticket URL: <https://code.djangoproject.com/ticket/9586#comment:9>

Django

unread,
Jul 6, 2013, 1:31:06 AM7/6/13
to django-...@googlegroups.com
#9586: Shall upload_to return an urlencoded string or not?
--------------------------------------+------------------------------------
Reporter: eibaan | Owner:
Type: Bug | Status: new

Component: File uploads/storage | Version: 1.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 1 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by susan):

* owner: susan =>
* status: assigned => new


--
Ticket URL: <https://code.djangoproject.com/ticket/9586#comment:10>

Django

unread,
Sep 20, 2013, 7:56:34 AM9/20/13
to django-...@googlegroups.com
#9586: Shall upload_to return an urlencoded string or not?
--------------------------------------+------------------------------------
Reporter: eibaan | Owner:
Type: Bug | Status: new
Component: File uploads/storage | Version: 1.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by timo):

* easy: 1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/9586#comment:11>

Django

unread,
May 7, 2014, 3:53:42 AM5/7/14
to django-...@googlegroups.com
#9586: Shall upload_to return an urlencoded string or not?
--------------------------------------+------------------------------------
Reporter: eibaan | Owner:
Type: Bug | Status: new
Component: File uploads/storage | Version: 1.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 1 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------

Comment (by anonymous):

Hi I just stumbled over this problem using Django 1.6.4 on windows.

Is there any idea when this bug will be fixed,
or is there a "howto" somewhere?

--
Ticket URL: <https://code.djangoproject.com/ticket/9586#comment:12>

Django

unread,
Jul 3, 2016, 8:15:18 AM7/3/16
to django-...@googlegroups.com
#9586: Shall upload_to return an urlencoded string or not?
--------------------------------------+------------------------------------
Reporter: eibaan | Owner:
Type: Bug | Status: new
Component: File uploads/storage | Version: 1.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by sergei-maertens):

* needs_better_patch: 1 => 0
* needs_tests: 1 => 0


Comment:

Looks like this was fixed by #25905 - I cannot reproduce the original
issue. I haven't tested on Windows though.

`models.py`:

{{{
#!python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models


def upload_to(instance, filename):
return 'Großköln / €/{}'.format(filename)


class FileModel(models.Model):
file = models.FileField(upload_to=upload_to)

}}}

`admin.py`
{{{
#!python
from django.contrib import admin

from .models import FileModel


admin.site.register(FileModel)
}}}

and the rest is the standard media/staticfiles settings/urls.

The url presented to me in the admin:

`<a href="/media/Gro%C3%9Fk%C3%B6ln%20/%20%E2%82%AC/mail.txt">Großköln /
€/mail.txt</a>`

which is properly escaped and served by django.

--
Ticket URL: <https://code.djangoproject.com/ticket/9586#comment:13>

Django

unread,
Jul 3, 2016, 8:16:46 AM7/3/16
to django-...@googlegroups.com
#9586: Shall upload_to return an urlencoded string or not?
--------------------------------------+------------------------------------
Reporter: eibaan | Owner:
Type: Bug | Status: closed

Component: File uploads/storage | Version: 1.0
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------+------------------------------------
Changes (by sergei-maertens):

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


--
Ticket URL: <https://code.djangoproject.com/ticket/9586#comment:14>

Reply all
Reply to author
Forward
0 new messages