[Django] #21934: Missing import statements (e.g. unicode literals)

1 view
Skip to first unread message

Django

unread,
Feb 3, 2014, 5:28:38 AM2/3/14
to django-...@googlegroups.com
#21934: Missing import statements (e.g. unicode literals)
------------------------------------+--------------------------
Reporter: david.fischer.ch@… | Owner: nobody
Type: Bug | Status: new
Component: Uncategorized | Version: master
Severity: Normal | Keywords: unicode,i18n
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------
There are a lot of source files that does not start with :

{{{
from __future__ import unicode_literals
}}}

I am developing a website that uses the GeoDjango framework to display
Google-based maps with french markers.
With the current release of the framework my website crashes with a bad
stack trace.

I haven't a lot of time to contribute to this project. So I do not want to
spend hours only to develop unit-tests that prove my small contribution
make it work.

I already tried to contribute to this project, I spent few minutes to fix
this issue and then hours to implement the unit-test that anyone can run
before / after the modifications to see that this will fix the issue.

Please, follow your own guildelines !!

https://docs.djangoproject.com/en/dev/ref/unicode/

... And add more accents to the strings in the unit-tests.

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

Django

unread,
Feb 3, 2014, 7:15:17 AM2/3/14
to django-...@googlegroups.com
#21934: Missing import statements (e.g. unicode literals)
------------------------------------+--------------------------------------
Reporter: david.fischer.ch@… | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: invalid

Keywords: unicode,i18n | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Changes (by russellm):

* status: new => closed
* needs_better_patch: => 0
* resolution: => invalid
* needs_tests: => 0
* needs_docs: => 0


Comment:

"Use `from __future__ import unicode_literals`" is a suggested practice.
It's a *good* suggested practice, a a helpful suggested practice for
maintenance purposes, but It's entirely possible to write working code
that doesn't use the unicode literals import. Django has a lot of legacy
code that has been tested and works fine (as far as our tests reveal)
without these imports existing.

"Just Add unicode_literals" isn't a magic bug fixing strategy - and even
if it was, we'd need a test that demonstrates the problem that it solves.

If you're getting a stack trace, then there's either a bug in your code,
or there's a bug in Django. Unfortunately, instead of showing us some
sample code that causes a problem, or showing us the actual stack trace
you've received, you've chosen to complain about absolute adherence to a
suggested coding guideline (and I'll note that the link you provide is
about using unicode in your own code, not Django's internal coding
standards).

Closing as invalid because there's nothing actionable here.

If you want to provide sample code that crashes, or a specific test case
where unicode_literals will fix the problem -- feel free to reopen.

--
Ticket URL: <https://code.djangoproject.com/ticket/21934#comment:1>

Django

unread,
Feb 3, 2014, 7:35:10 AM2/3/14
to django-...@googlegroups.com
#21934: Missing import statements (e.g. unicode literals)
------------------------------------+--------------------------------------
Reporter: david.fischer.ch@… | Owner: nobody
Type: Bug | Status: closed
Component: Uncategorized | Version: master
Severity: Normal | Resolution: needsinfo

Keywords: unicode,i18n | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
------------------------------------+--------------------------------------
Changes (by aaugustin):

* resolution: invalid => needsinfo


Comment:

I wouldn't call that bug "invalid". It's true that we I dropped the ball
mid-way with regard to unicode_literals while porting to Python 3.

I stopped when I reached code that wasn't well tested, mostly in
django.contrib.gis, because adding unicode_literals created actual bugs.
Adding unicode_literals to every file isn't an option. It would trigger a
slew of regressions.

That said, we should continue adding unicode_literals when we have the
opportunity, which means, when we add tests.

Re-closing "needsinfo", please provide the stack trace for the problem you
encountered and reopen.

--
Ticket URL: <https://code.djangoproject.com/ticket/21934#comment:2>

Django

unread,
Feb 3, 2014, 7:45:19 AM2/3/14
to django-...@googlegroups.com
#21934: Missing import statements (e.g. unicode literals) in contrib.gis
------------------------------------+------------------------------------

Reporter: david.fischer.ch@… | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: unicode,i18n | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------
Changes (by timo):

* status: closed => new
* needs_better_patch: 0 => 1
* component: Uncategorized => GIS
* has_patch: 0 => 1
* resolution: needsinfo =>
* stage: Unreviewed => Accepted


Comment:

I believe this references [https://github.com/django/django/pull/1797 this
PR].

--
Ticket URL: <https://code.djangoproject.com/ticket/21934#comment:3>

Django

unread,
Feb 3, 2014, 7:46:30 AM2/3/14
to django-...@googlegroups.com
#21934: Missing import statements (e.g. unicode literals) in contrib.gis
------------------------------------+------------------------------------

Reporter: david.fischer.ch@… | Owner: nobody
Type: Bug | Status: new
Component: GIS | Version: master
Severity: Normal | Resolution:
Keywords: unicode,i18n | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------

Comment (by david.fischer.ch@…):

Please find this new commit https://github.com/davidfischer-
ch/django/commit/4f810ee43d2cfe0af9dc0076fb1b0c5754e9d65f.

I destroyed my previous fork to start from scratch.

--
Ticket URL: <https://code.djangoproject.com/ticket/21934#comment:4>

Django

unread,
Feb 3, 2014, 10:19:05 AM2/3/14
to django-...@googlegroups.com
#21934: Missing import statements (e.g. unicode literals) in contrib.gis
------------------------------------+------------------------------------
Reporter: david.fischer.ch@… | Owner: nobody
Type: Bug | Status: closed
Component: GIS | Version: master
Severity: Normal | Resolution: fixed

Keywords: unicode,i18n | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
------------------------------------+------------------------------------
Changes (by Claude Paroz <claude@…>):

* status: new => closed

* resolution: => fixed


Comment:

In [changeset:"e7e3435b4d0d409aa98a66d2d7961f7541d19f9f"]:
{{{
#!CommitTicketReference repository=""
revision="e7e3435b4d0d409aa98a66d2d7961f7541d19f9f"
Fixed #21934 -- Added unicode support in GoogleMap class
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/21934#comment:5>

Reply all
Reply to author
Forward
0 new messages