Django + Djang-Model-Utils UnicodeEncodeError with Cyrillic symbols

2019-09-26 Thread Akira Furude
I have StackOverflow question <https://stackoverflow.com/questions/58105372/django-model-utils-unicodeencodeerror> where i described and kind of "solved" this interesting bug. At the moment, I need help at UPD 3 section. -- You received this message because you are subscrib

Re: Ayuda con el error: UnicodeEncodeError: 'ascii' codec can't encode character '\xf3' in position 7: ordinal not in range(128)

2019-05-07 Thread Phako Perez
> Hola amigos, me podrían ayudar aresolver este error: > > UnicodeEncodeError: 'ascii' codec can't encode character '\xf3' in position > 7: ordinal not in range(128)} > > Esto me paso cuando estaba creando el super usuario en django > > -- > Y

Ayuda con el error: UnicodeEncodeError: 'ascii' codec can't encode character '\xf3' in position 7: ordinal not in range(128)

2019-05-07 Thread noel moreira
Hola amigos, me podrían ayudar aresolver este error: UnicodeEncodeError: 'ascii' codec can't encode character '\xf3' in position 7: ordinal not in range(128)} Esto me paso cuando estaba creando el super usuario en django -- You received this message because you are

Re: 2.2a1: django-admin migrate throws UnicodeEncodeError

2019-02-12 Thread Tim Graham
s about how to solve it: > https://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20/39293287 > > On Friday, February 1, 2019 at 1:49:07 PM UTC-5, axel...@chaos1.de wrote: >> >> Hi, >> >> File >>

Re: 2.2a1: django-admin migrate throws UnicodeEncodeError

2019-02-01 Thread Tim Graham
I think your shell/terminal isn't configured for Unicode. Take a look here for some ideas about how to solve it: https://stackoverflow.com/questions/9942594/unicodeencodeerror-ascii-codec-cant-encode-character-u-xa0-in-position-20/39293287 On Friday, February 1, 2019 at 1:49:07 PM UTC-5,

2.2a1: django-admin migrate throws UnicodeEncodeError

2019-02-01 Thread Axel Rau
-django/lib/python3.6/site-packages/django/core/management/base.py", line 145, in write self._out.write(style_func(msg)) UnicodeEncodeError: 'ascii' codec can't encode character '\u2026' in position 48: ordinal not in range(128) Should stdout not recei

Re: A Problem about UnicodeEncodeError

2016-04-25 Thread Mike Dewhirst
On 25/04/2016 10:29 PM, nku@gmail.com wrote: Thank you for your help. But my project is not in the desktop folder. I'll show you the traceback information: Well I don't think I can help. I can say that my development setup has given me no trouble at all. What works for me is ... C:\Users

Re: A Problem about UnicodeEncodeError

2016-04-25 Thread nku . mtl
Thank you for your help. But my project is not in the desktop folder. I'll show you the traceback information: 在 2016年4月24日星期日 UTC+8下午12:56:26,Mike Dewhirst写道: > > On 24/

Re: A Problem about UnicodeEncodeError

2016-04-23 Thread Mike Dewhirst
"python manage.py runserver", Â Â the cmd show the error information: Â Â Â Â Â Â Â UnicodeEncodeError: 'mbcs' codec can't encode characters in position 0--1: invalid character I have search for a long time but didn't ge

Re: A Problem about UnicodeEncodeError

2016-04-23 Thread nku . mtl
ject following the tutorial successfully , but >> when I ran the command "python manage.py runserver", >> >> the cmd show the error information: >> UnicodeEncodeError: 'mbcs' codec can't encode characters in >> position 0--1:

Re: A Problem about UnicodeEncodeError

2016-04-22 Thread Steven Crockett
mmand "python manage.py runserver", > > the cmd show the error information: > UnicodeEncodeError: 'mbcs' codec can't encode characters in > position 0--1: invalid character > > I have search for a long time but didn't get the solution. > Coul

A Problem about UnicodeEncodeError

2016-04-22 Thread nku . mtl
Hello, I'm a beginner of Python. Recently,I want to learn something about django.But I meet a problem: I created a django project following the tutorial successfully , but when I ran the command "python manage.py runserver", the cmd show the error information: Uni

Re: UnicodeEncodeError: 'charmap' codec can't encode character u'\u0218' in position 0: character maps to

2016-03-25 Thread Zoltán Bege
gt; > Firebird 2.5 DB with cp1250 encoding. > > Yesterday I got some Internal Server Error while updating a person's > first > > or last name when using Ș, ș, Ț, ț characters. > > > > The error can be easily reproduced in python (2.7 and 3.4) shell: > > >

Re: UnicodeEncodeError: 'ascii' codec can't encode characters in position,,, on handling serialized post data

2016-03-25 Thread Wu Jakey
ing is unicode , not utf8 , so you can not make unicode to unicode , you should use "unquote(u'Kroati%C3%AB').encode("utf8").decode("utf8")" 在 2016年3月25日星期五 UTC+8上午4:34:10,Paul Bormans写道: > > I have been puzzled for some time now on a UnicodeEnc

Re: UnicodeEncodeError: 'charmap' codec can't encode character u'\u0218' in position 0: character maps to

2016-03-25 Thread Michal Petrucha
st name when using Ș, ș, Ț, ț characters. > > The error can be easily reproduced in python (2.7 and 3.4) shell: > >>> u'Ș'.encode('cp1250') > UnicodeEncodeError: 'charmap' codec can't encode character u'\u0218' in > position

UnicodeEncodeError: 'charmap' codec can't encode character u'\u0218' in position 0: character maps to

2016-03-25 Thread Zoltán Bege
7 and 3.4) shell: >>> u'Ș'.encode('cp1250') UnicodeEncodeError: 'charmap' codec can't encode character u'\u0218' in position 0: character maps to How I can encode the mentioned characters in cp1250 to avoid this error? I must use the Firebi

Re: UnicodeEncodeError: 'ascii' codec can't encode characters in position,,, on handling serialized post data

2016-03-24 Thread Stephen J. Butler
What happens if you don't pass POST['f'] through unquote first? I don't believe that should be necessary. return QueryDict(request.POST["f"]) On Thu, Mar 24, 2016 at 2:57 PM, Paul Bormans wrote: > I have been puzzled for some time now on a UnicodeEncode

UnicodeEncodeError: 'ascii' codec can't encode characters in position,,, on handling serialized post data

2016-03-24 Thread Paul Bormans
I have been puzzled for some time now on a UnicodeEncodeError exception that i get when unicode characters are getting posted to the server. After testing several options i can work around the exception but it does not feel right so i thought to post the issue + the solution that seems to work

Logging \u2083 as cp1252 UnicodeEncodeError in Python 3.4

2014-11-24 Thread Mike Dewhirst
call last): File "C:\Python34\Lib\logging\__init__.py", line 980, in emit stream.write(msg) File "C:\Users\mike\env\xxdx3\lib\encodings\cp1252.py", line 19, in encode return codecs.charmap_encode(input,self.errors,encoding_table)[0] UnicodeEncodeError: 'charmap' c

Re: Django UnicodeEncodeError in errorlist

2012-04-26 Thread Bill Freeman
e<https://github.com/django/django/blob/1.3.1/django/utils/encoding.py#L74> > : > > s = unicode(str(s), encoding, errors) > > and then translation in > lazy<https://github.com/django/django/blob/1.3.1/django/utils/functional.py#L209> > : > > def __str_cast(self): >

Django UnicodeEncodeError in errorlist

2012-04-26 Thread Andrei
s://github.com/django/django/blob/1.3.1/django/utils/functional.py#L209> : def __str_cast(self): return str(self.__func(*self.__args, **self.__kw)) The problem is that my string contains 'å' symbol and str(u'å') raises UnicodeEncodeError. Is there a good reason wh

Re: UnicodeEncodeError in file uploads

2012-03-02 Thread Andreas Hasenkopf
In some older group post I found a nice django-based solution: Using a customized ImageField instance: class MyImageField(ImageField): def __init__(self, *args, **kwargs): super(MyImageField, self).__init__(*args, **kwargs) def clean(self, *args, **kwargs): data = super(M

Re: UnicodeEncodeError in file uploads

2012-03-02 Thread Andreas Hasenkopf
Hi there, tried upload of file containing file with umlaut in filename on a Ubuntu server with de_DE.UTF8 locale setting. This server also produces a UnicodeEncodeError error. locale -a gives the following output: C en_AG en_AU.utf8 en_BW.utf8 en_CA.utf8 en_DK.utf8 en_GB.utf8 en_HK.utf8

Re: UnicodeEncodeError in file uploads

2012-03-01 Thread Aljoša Mohorović
On Thu, Mar 1, 2012 at 6:16 PM, andi-h wrote: > Would it help to change the locale settings on this Ubuntu server to > de_DE.UTF-8, too? don't know, but give it a shot. also, what's the output of: $ locale -a Aljosa -- You received this message because you are subscribed to the Google Groups

Re: UnicodeEncodeError in file uploads

2012-03-01 Thread andi-h
1) $ cat /etc/apache2/envvars export APACHE_RUN_USER=www-data export APACHE_RUN_GROUP=www-data export APACHE_PID_FILE=/var/run/apache2.pid . /etc/default/locale export LANG # comments have been stripped 2) $ cat /etc/default/locale LANG="en_US.UTF-8" $ sudo su - www-data $ export export HOME='/var

Re: UnicodeEncodeError in file uploads

2012-03-01 Thread Aljoša Mohorović
although it's possible that this is not the problem, could you post additional details after you restart apache: 1) envvars content $ cat /etc/apache2/envvars 2) env settings for apache/site user (usually www-data): $ cat /etc/default/locale $ sudo su - www-data $ export Aljosa -- You received

Re: UnicodeEncodeError in file uploads

2012-03-01 Thread andi-h
Hi, as you suggested I changed that settings. In addition I made a new MySQL database with an UTF8 collation and copied all the data to that one. No change, I still got the same problem :-( -- You received this message because you are subscribed to the Google Groups "Django users" group. T

Re: UnicodeEncodeError in file uploads

2012-03-01 Thread Aljoša Mohorović
if you're using apache please check /etc/apache2/envvars and make sure that LANG is not C. if you uncomment system locale it should work as expected. ## Uncomment the following line to use the system default locale instead: . /etc/default/locale Aljosa Mohorovic -- You received this message bec

Re: Please help me figure out this UnicodeEncodeError

2010-11-10 Thread Daniel Roseman
On Nov 10, 2:25 am, Eric Chamberlain wrote: > Hi, can anyone tell me how to work around this UnicodeEncodeError? > > >>> from hashlib import md5 > >>> full_jid = u'e...@example.com/Eric\u2019s iPhone 3GS' > >>> hash = md5(full_jid) > >

Please help me figure out this UnicodeEncodeError

2010-11-09 Thread Eric Chamberlain
Hi, can anyone tell me how to work around this UnicodeEncodeError? >>> from hashlib import md5 >>> full_jid = u'e...@example.com/Eric\u2019s iPhone 3GS' >>> hash = md5(full_jid) Traceback (most recent call last): File "", line 1, in UnicodeEnco

Re: UnicodeEncodeError

2010-10-04 Thread roboter
> > > File "/usr/languages/python/2.6/lib/python2.6/genericpath.py", line 18, in > > exists > >st =os.stat(path) > > >UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position > > 53: ordinal not in rang

Re: UnicodeEncodeError

2010-10-01 Thread Benedict Verheyen
ask my client to rename their files without any special > char > not the best solution but a good habit anyway =) > > cheers, > _y > > > On Sep 30, 2:20 pm, Karen Tracey wrote: >> On Wed, Sep 29, 2010 at 12:59 PM, jean polo >> wrote: >> >> >

Re: UnicodeEncodeError

2010-10-01 Thread Klaas van Schelven
would try to encode using ascii anyway. Klaas >  File "/usr/languages/python/2.6/lib/python2.6/genericpath.py", line 18, in > exists >    st = os.stat(path) > > UnicodeEncodeError: 'ascii' codec can't encode character u'\xe7' in position > 53: ord

Re: UnicodeEncodeError

2010-09-30 Thread Karen Tracey
file is irrelevant to this problem: it is the file's name that is causing the problem. The last bit of the traceback is: File "/usr/languages/python/2.6/lib/python2.6/genericpath.py", line 18, in exists st = os.stat(path) UnicodeEncodeError: 'ascii' codec can't

Re: UnicodeEncodeError

2010-09-30 Thread werefr0g
Sorry, sorry I proposed Jean to send me the actual file to check its encoding. I asked for his OS too in order to see what editor are available and how it allows to "transcode" the text. -- You received this message because you are subscribed to the Google Groups "Django users" group. To

Re: UnicodeEncodeError

2010-09-30 Thread jean polo
best solution but a good habit anyway =) cheers, _y On Sep 30, 2:20 pm, Karen Tracey wrote: > On Wed, Sep 29, 2010 at 12:59 PM, jean polo wrote: > > > > > Hi. > > I get an 'UnicodeEncodeError' if I upload a file (ImageField) with non- > > ascii chars in

Re: UnicodeEncodeError

2010-09-30 Thread Karen Tracey
On Wed, Sep 29, 2010 at 12:59 PM, jean polo wrote: > Hi. > I get an 'UnicodeEncodeError' if I upload a file (ImageField) with non- > ascii chars in my application (django-1.2.1). > > I added: > > export LANG='en_US.UTF-8' > export LC_ALL='en_US.UTF

Re: UnicodeEncodeError

2010-09-29 Thread jean polo
On Sep 29, 11:24 pm, werefr0g wrote: >   Tu peux m'envoyer ton fichier ? je v�rifie son encodage. ca y est > Sinon, quel OS utilises-tu ? I use ubuntu 9.10 (but problem is the same with osx or windows) > > Le 29/09/2010 23:14, jean polo a �crit : > > > On Sep 29, 10:38 pm, werefr0g  wrote:

Re: UnicodeEncodeError

2010-09-29 Thread werefr0g
Tu peux m'envoyer ton fichier ? je vérifie son encodage. Sinon, quel OS utilises-tu ? Le 29/09/2010 23:14, jean polo a écrit : On Sep 29, 10:38 pm, werefr0g wrote: Jean, Sorry, the three points are: ># -*- coding: utf-8 -*- line > checking the module's file is actually utf-8 e

Re: UnicodeEncodeError

2010-09-29 Thread jean polo
On Sep 29, 10:38 pm, werefr0g wrote: >   Jean, > > Sorry, the three points are: > >  >  # -*- coding: utf-8 -*- line >  > checking the module's file is actually utf-8 encoded >  > using codecs module for file like read/ write operations. Well, not sure I have the skills to check these (except the

Re: UnicodeEncodeError

2010-09-29 Thread werefr0g
Jean, Sorry, the three points are: > # -*- coding: utf-8 -*- line > checking the module's file is actually utf-8 encoded > using codecs module for file like read/ write operations. -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to t

Re: UnicodeEncodeError

2010-09-29 Thread jean polo
On Sep 29, 9:42 pm, werefr0g wrote: >   Isn't the filename a string? > > It may not be the solution but I think you should try them at least > since they are very quick to apply. As I saw something implying os > module I thought that before Django handles the string, it must encode > by os module.

Re: UnicodeEncodeError

2010-09-29 Thread werefr0g
Isn't the filename a string? It may not be the solution but I think you should try them at least since they are very quick to apply. As I saw something implying os module I thought that before Django handles the string, it must encode by os module. I found that using previously written step

Re: UnicodeEncodeError

2010-09-29 Thread jean polo
on/django/1.2.1/django/core/files/ storage.py", line 73, in get_available_name while self.exists(name): File "/usr/local/alwaysdata/python/django/1.2.1/django/core/files/ storage.py", line 196, in exists return os.path.exists(self.path(name)) File "/usr/lan

Re: UnicodeEncodeError

2010-09-29 Thread Steve Holden
>> On 9/29/2010 1:05 PM, werefr0g wrote: >> >> >> >>> Hi, >> >>> You should check that your file is actually utf-8 encoded and add the >>> folliwing right after shebang: >>> # -*- coding: utf-8 -*- >> >>> Le 29/09/2010 18:

Re: UnicodeEncodeError

2010-09-29 Thread Petite Abeille
On Sep 29, 2010, at 8:01 PM, jean polo wrote: > I have a basic 'Bien' class and a *very basic* 'Image' class (with a > ForeignKey to Bien). > BienAdmin has a ImageInline and that's all. Not even tangentially related, but... "Do people in non-English-speaking countries code in English?" http://p

Re: UnicodeEncodeError

2010-09-29 Thread jean polo
>  Hi, > > > You should check that your file is actually utf-8 encoded and add the > > folliwing right after shebang: > > # -*- coding: utf-8 -*- > > > Le 29/09/2010 18:59, jean polo a crit : > >> Hi. > >> I get an 'UnicodeEncodeError'

Re: UnicodeEncodeError

2010-09-29 Thread jean polo
sorry if I was not clear but I don't get you. this happens only in the admin when uploading a file (say 'file_é.jpg') for an object. saving the modifications gives the UnicodeEncodeError.. Modifying the same object (still in the admin) and uploading a standard imagefile (which nam

Re: UnicodeEncodeError

2010-09-29 Thread Steve Holden
8 encoded and add the > folliwing right after shebang: > # -*- coding: utf-8 -*- > > Le 29/09/2010 18:59, jean polo a écrit : >> Hi. >> I get an 'UnicodeEncodeError' if I upload a file (ImageField) with non- >> ascii chars in my application (django-1.2.

Re: UnicodeEncodeError

2010-09-29 Thread werefr0g
Hi, You should check that your file is actually utf-8 encoded and add the folliwing right after shebang: # -*- coding: utf-8 -*- Le 29/09/2010 18:59, jean polo a écrit : Hi. I get an 'UnicodeEncodeError' if I upload a file (ImageField) with non- ascii chars in my application (dj

UnicodeEncodeError

2010-09-29 Thread jean polo
Hi. I get an 'UnicodeEncodeError' if I upload a file (ImageField) with non- ascii chars in my application (django-1.2.1). I added: export LANG='en_US.UTF-8' export LC_ALL='en_US.UTF-8' in my /etc/apache2/envvars as stated here: http://docs.djangoproject.com/en/dev/

Re: UnicodeEncodeError

2010-07-31 Thread Daniel Roseman
On Jul 30, 11:17 pm, EricBrian wrote: > Daniel, if I don't do that, I get the unicode error in the list of > dashboards in the admin section. > You'd better post the traceback for that, then. Just to be clear, your method should look like this: def __unicode__(self): return self.nam

Re: UnicodeEncodeError

2010-07-30 Thread EricBrian
ew > > 901. self.log_change(request, new_object, > > change_message) > > File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/ > > python2.6/site-packages/django/contrib/admin/options.py" in log_change > > 443. object_repr

Re: UnicodeEncodeError

2010-07-30 Thread Daniel Roseman
options.py" in log_change >   443.             object_repr     = force_unicode(object), > File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/ > python2.6/site-packages/django/utils/encoding.py" in force_unicode >   66.                 s = unicode(s) > File

UnicodeEncodeError

2010-07-29 Thread Eric
_unicode__ 47. return u"%s" % self.name.decode('utf-8') File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/ python2.6/encodings/utf_8.py" in decode 16. return codecs.utf_8_decode(input, errors, True) Exception Type: UnicodeEn

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-05-06 Thread Michael Strickland
Sorry for the delayed response - And yeah, I'm using cmemcached - looks like the django docs have been updated in the past month to show it's deprecated. Thanks! On Apr 19, 9:08 am, Karen Tracey wrote: > On Sun, Apr 18, 2010 at 3:54 AM, Michael Strickland > wrote: > > > > > > > Temporary fix: >

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-19 Thread Karen Tracey
On Sun, Apr 18, 2010 at 3:54 AM, Michael Strickland wrote: > Temporary fix: > > It appears to be a result of changeset [12637] in memcached.py: > http://code.djangoproject.com/changeset/12637 > > # memcached.py, lines 53-54 removed in def set() > 53: if isinstance(value, unicode): > 54:value

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-18 Thread Michael Strickland
Temporary fix: It appears to be a result of changeset [12637] in memcached.py: http://code.djangoproject.com/changeset/12637 # memcached.py, lines 53-54 removed in def set() 53: if isinstance(value, unicode): 54:value = value.encode('utf-8') In my templates at least, this means that before

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread Daniel Roseman
On Apr 5, 11:53 am, Willem wrote: > Thanks DR -- see below > > class ProfileManager(models.Manager): > >     def recently_added_people(self): >         cache_key = 'recently_added_people' >         profile_list = cache.get(cache_key) >         if profile_list is None: >             list = Profile.

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread Willem
Thanks DR -- see below class ProfileManager(models.Manager): def recently_added_people(self): cache_key = 'recently_added_people' profile_list = cache.get(cache_key) if profile_list is None: list = Profile.objects.order_by('-id').filter(

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread Daniel Roseman
On Apr 5, 10:42 am, Willem wrote: > If I unicode(the_list) in views.py -- the list becomes un-us able in > my template... > > See:  http://bit.ly/aXTW5pfor the error on my site It would be useful to see the definition of your Profile class - especially the __unicode__ method, if you have one. --

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread Willem
If I unicode(the_list) in views.py -- the list becomes un-us able in my template... See: http://bit.ly/aXTW5p for the error on my site -- You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-us...@googlegro

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread ankit rai
from django.utils.encoding import * # views.py ## def country_detail(request, country_code): profiles = Profile.objects.filter(country__shortcode=country_code).filter(user__is_active='1') return render_to_response('people/country.html',{ 'country_code': country_code, 'country

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread ankit rai
from django.utils.encoding import * # views.py ## def country_detail(request, country_code): profiles = Profile.objects.filter(country__shortcode=country_code).filter(user__is_active='1') return render_to_response('people/country.html',{ 'country_code': country_code, 'country

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread Willem
ankit, I understand the error is related to unicode -- but it is not clear where the unicode() statement must go. Where in my code in views.py ## views.py ## def country_detail(request,country_code): profiles = Profile.objects.filter(country__shortcode=country_code).filter(user__is_active='1

Re: ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread ankit rai
use encoding method unicode(str).encde("UTF-8") On Mon, Apr 5, 2010 at 12:59 PM, Willem wrote: > I get following error: > > "Caught UnicodeEncodeError while rendering: 'ascii' codec can't encode > character u'\xe1' in position 161: o

ERROR: Caught UnicodeEncodeError while rendering: 'ascii' codec

2010-04-05 Thread Willem
I get following error: "Caught UnicodeEncodeError while rendering: 'ascii' codec can't encode character u'\xe1' in position 161: ordinal not in range(128)" If I comment out the cache line in template -- all is OK Any ideas? Many thanks -

Re: TemplateSyntaxError Caught UnicodeEncodeError while rendering

2010-03-30 Thread Alessandro Pasotti
2010/3/30 Karen Tracey > On Tue, Mar 30, 2010 at 5:45 PM, Alessandro Pasotti wrote: > >> Hello, >> >> >> Exception Type: TemplateSyntaxError at >> /resource/news/un-nuovo-ostello-sulla-francigena/ >> Exception Value: Caught UnicodeEncodeError whil

Re: TemplateSyntaxError Caught UnicodeEncodeError while rendering

2010-03-30 Thread Karen Tracey
(self.path(name)) > File "/usr/lib/python2.5/posixpath.py" in getsize > 139. return os.stat(filename).st_size > > Exception Type: TemplateSyntaxError at > /resource/news/un-nuovo-ostello-sulla-francigena/ > Exception Value: Caught UnicodeEncodeError while rendering:

TemplateSyntaxError Caught UnicodeEncodeError while rendering

2010-03-30 Thread Alessandro Pasotti
at(filename).st_size Exception Type: TemplateSyntaxError at /resource/news/un-nuovo-ostello-sulla-francigena/ Exception Value: Caught UnicodeEncodeError while rendering: 'ascii' codec can't encode character u'\xe0' in position 108: ordinal not in range(128) filename=u&#

UnicodeEncodeError on the admin when using translations

2010-02-05 Thread Juanjux (Google)
File "/usr/lib/python2.5/site-packages/django/db/models/fields/ related.py" in contribute_to_class 105. self.do_related_class(other, cls) File "/usr/lib/python2.5/site-packages/django/db/models/fields/ related.py" in do_related_class 117. self.contribute

Re: Admin UnicodeEncodeError

2009-12-16 Thread goome
On 16 Dic, 04:03, Karen Tracey wrote: > On Tue, Dec 15, 2009 at 2:42 PM, goome wrote: > > Hello > > i have a model with a CharField field. > > When in the admin panel i try to insert a new record for the model > > with a text containing "é" for the fiel

Re: Admin UnicodeEncodeError

2009-12-15 Thread Karen Tracey
On Tue, Dec 15, 2009 at 2:42 PM, goome wrote: > Hello > i have a model with a CharField field. > When in the admin panel i try to insert a new record for the model > with a text containing "é" for the field, i got > """UnicodeEncodeError at /admin/abruz

Admin UnicodeEncodeError

2009-12-15 Thread goome
Hello i have a model with a CharField field. When in the admin panel i try to insert a new record for the model with a text containing "é" for the field, i got """UnicodeEncodeError at /admin/abruzzodavedere/servizio/4/ 'ascii' codec can't encode characte

Re: when my url contains utf-8 characters such as chinese, it's occurs an UnicodeEncodeError

2009-11-23 Thread Karen Tracey
2009/11/23 VespertineR Lau > when my url contains utf-8 characters such as chinese, it's occurs an > UnicodeEncodeError: > > [snip] > Traceback: > File "/usr/lib/python2.4/site-packages/django/core/handlers/base.py" > in get_response > 92.

when my url contains utf-8 characters such as chinese, it's occurs an UnicodeEncodeError

2009-11-23 Thread VespertineR Lau
when my url contains utf-8 characters such as chinese, it's occurs an UnicodeEncodeError: UnicodeEncodeError at /upload/snap/屏幕快照_2009-11-19_下午09.54.12.png 'ascii' codec can't encode characters in position 39-42: ordinal not in range(128) Request Method: G

Re: UnicodeEncodeError in models

2009-09-16 Thread Gabriel .
On Wed, Sep 16, 2009 at 3:32 PM, Karen Tracey wrote: > repr needs to return a string, you are returning unicode.  The automatic > unicode-to-string conversion done by Python will use the ascii codec, which > has no way of representing 'ã'. You should probably be returning the repr of > the unicod

Re: UnicodeEncodeError in models

2009-09-16 Thread Karen Tracey
e': self.filename, >'component': self.component.name, >'release': self.release.name,} > > (I tried also with ugettext) > > I'm getting an UnicodeEncodeError when I call this method and the > language is Portuguese (the trans

Re: UnicodeEncodeError in models

2009-09-16 Thread Gabriel .
On Wed, Sep 16, 2009 at 3:02 PM, Daniel Roseman wrote: >> >>     def __repr__(self): >>         return ugettext_lazy("%(file)s (Component: %(component)s - >> Release: %(release)s)") % { >>             'file': self.filename, >>             'component': self.component.name, >>             'release'

Re: UnicodeEncodeError in models

2009-09-16 Thread Daniel Roseman
27;file': self.filename, >             'component': self.component.name, >             'release': self.release.name,} > > (I tried also with ugettext) > > I'm getting an UnicodeEncodeError when I call this method and the > language is Portuguese (the translat

UnicodeEncodeError in models

2009-09-16 Thread Gabriel .
7;release': self.release.name,} (I tried also with ugettext) I'm getting an UnicodeEncodeError when I call this method and the language is Portuguese (the translated version is: "%(file)s (componente: %(component)s - versão: %(release)s)"). The 'ã' is causing problem

Re: UnicodeEncodeError on csv export

2009-08-20 Thread David De La Harpe Golden
andreas schmid wrote: > hi, > > i successfully made a csv export view for a queryset but i have the > problem with some characters... > how can i encode the queryset passed to the csv writer to solve my problem? > FWIW, I just did the following: for line in lines: writer.writerow

Re: UnicodeEncodeError on csv export

2009-08-20 Thread andreas schmid
i used the template method to get it working because it was the faster and easier way thank you for pointing me there! if someone knows how to make it work directly with the python csv i would be interested to see how it should be implemented! mettwoch wrote: > I ran into the same problem

Re: UnicodeEncodeError on csv export

2009-08-20 Thread mettwoch
I ran into the same problem and I found in the Python documentation that the csv module has some Unicode issues ... http://docs.python.org/library/csv.html?highlight=csv#module-csv ... with an attempt to getting around it with a wrapper ... http://docs.python.org/library/csv.html?highlight=csv#

UnicodeEncodeError on csv export

2009-08-20 Thread andreas schmid
hi, i successfully made a csv export view for a queryset but i have the problem with some characters... how can i encode the queryset passed to the csv writer to solve my problem? #my csvexport.py import csv from django.http import HttpResponse from django.contrib.auth.decorators im

Re: UnicodeEncodeError on admin site

2009-07-21 Thread Rodrigo Gomes
Hi Daniel, I just changed my method as you suggested, to def __unicode__(self) and the problem was solved. Thanks so much! Rodrigo On Tue, Jul 21, 2009 at 12:54 PM, Daniel Roseman wrote: > > On Jul 21, 3:46 pm, Rodrigo Gomes wrote: > > Hi Daniel, > > > > My databse enconding (Mysql) is utf-8,

Re: UnicodeEncodeError on admin site

2009-07-21 Thread Daniel Roseman
On Jul 21, 3:46 pm, Rodrigo Gomes wrote: > Hi Daniel, > > My databse enconding (Mysql) is utf-8, as you can see below: > > Server characterset:    latin1 > Db     characterset:    utf8 > Client characterset:    latin1 > Conn.  characterset:    latin1 But what about your actual tables? When you d

Re: UnicodeEncodeError on admin site

2009-07-21 Thread Rodrigo Gomes
ckages/django/template/__init__.py", > > line 559, in resolve > > > > new_obj = func(obj, *arg_vals) > > File > "/Library/Python/2.5/site-packages/django/template/defaultfilters.py", > > line 38, in _dec > > args[0] = force_unicode(ar

Re: UnicodeEncodeError on admin site

2009-07-21 Thread Daniel Roseman
/django/template/__init__.py", > line 559, in resolve > >     new_obj = func(obj, *arg_vals) >   File "/Library/Python/2.5/site-packages/django/template/defaultfilters.py", > line 38, in _dec >     args[0] = force_unicode(args[0]) >   File "/Library/Pyth

UnicodeEncodeError on admin site

2009-07-21 Thread Rodrigo Gomes
", line 38, in _dec args[0] = force_unicode(args[0]) File "/Library/Python/2.5/site-packages/django/utils/encoding.py", line 52, in force_unicode s = unicode(str(s), encoding, errors) UnicodeEncodeError: 'ascii' codec can't encode character u'\xed'

Re: UnicodeEncodeError

2009-05-21 Thread Sean Brant
i.out', 'w') > >>> print >> stderr, '%s' % u > Traceback (most recent call last): > File "", line 1, in > UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' > in position 0: ordinal not in

Re: UnicodeEncodeError

2009-05-21 Thread Karen Tracey
t', 'w') >>> print >> stderr, '%s' % u Traceback (most recent call last): File "", line 1, in UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in position 0: ordinal not in range(128) >>> import

Re: UnicodeEncodeError

2009-05-21 Thread Karen Tracey
gt; commands/grabentries.py", line 73, in handle > > print '[%s] Saved - Entry "%s"' % (datetime.now(), entry.title) > > UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in > > position 56: ordinal not in r

Re: UnicodeEncodeError

2009-05-20 Thread Daniel Roseman
/entries/management/ > commands/grabentries.py", line 73, in handle >     print '[%s] Saved - Entry "%s"' % (datetime.now(), entry.title) > UnicodeEncodeError: 'ascii' codec can't encode character u'\u2013' in > position 56: ordinal not in rang

UnicodeEncodeError

2009-05-20 Thread Sean Brant
124/data/python/django/django/core/management/ base.py", line 222, in execute output = self.handle(*args, **options) File "/home/58124/containers/django/contest/apps/entries/management/ commands/grabentries.py", line 73, in handle print '[%s] Saved - Entry "%s"'

Re: UnicodeEncodeError

2009-05-07 Thread 不提防
When LANG = C, os.stat(u'中文.txt') will make a error. UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-5: ordinal not in range(128) os.environ['LANG']='utf8' os.stat(u'中文.txt') also makes that error. In my program, I

Re: UnicodeEncodeError

2009-04-28 Thread Karen Tracey
2009/4/28 > > UnicodeEncodeError at /admin/articles/article/18248/ > > ('ascii', u'/home/httpd/html/media/doc/2009/04/28/\u90b3\u5dde\u516c > \u53f8\u8df5\u884c\u79d1\u5b66\u53d1\u5c55\u89c2\u670d > \u52a1\u53d1\u5c55\u5f53\u5148\u950b.jpg', 38, 56, 

Re: UnicodeEncodeError

2009-04-28 Thread Daniel Roseman
On Apr 28, 8:00 am, liog...@gmail.com wrote: > UnicodeEncodeError at /admin/articles/article/18248/ > Yes, you have an error. -- DR. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Django users" g

UnicodeEncodeError

2009-04-28 Thread lioGeng
UnicodeEncodeError at /admin/articles/article/18248/ ('ascii', u'/home/httpd/html/media/doc/2009/04/28/\u90b3\u5dde\u516c \u53f8\u8df5\u884c\u79d1\u5b66\u53d1\u5c55\u89c2\u670d \u52a1\u53d1\u5c55\u5f53\u5148\u950b.jpg', 38, 56, 'ordinal not in range(128)') Reques

Re: UnicodeEncodeError with gettext

2009-02-27 Thread Scott
Updating this after problem resolution, the issue was with the translation (.po and .mo) files, not Django itself. Old gettext with Windows may have been the culprit, found using Linux to create the message files much more reliable. On Feb 12, 10:21 am, Scott wrote: > Hi Karen, > > Thanks for th

  1   2   >