On Wed, Mar 17, 2010 at 1:08 PM, Tom Evans <tevans...@googlemail.com> wrote:
> Hmm, still a bit confused why it doesn't exhibit the issue under a > regular python 2.5 shell if it is a python 2.5 issue. Something > definitely 'tweaks' the environment going through the django shell > rather than the python shell. Must only be triggered in certain edge > cases, I suppose. > I don't remember the details exactly, but I believe it's a bug for input read by code.interact(). manage.py shell calls code.interact() to present the interpreter shell, and what you enter at the shell is processed as input by code.interact(). The Python shell invoked directly via the python executable does not use code.interact(), so you see the problem when running under python manage.py shell, but not the plain Python shell. > However, that does explain the failing tests. I am initiating one side > of the RPC from the shell, for testing, like so: > > >>> checkBounceUser('10.0.0.1', {'X-Hi': u'£' }, sp=settings.SSO_ID) > > which then prints out the extracted arguments in the console of the > other server: > name: X-Hi value: £ > repr(name): u'X-Hi' repr(value): u'\xc2\xa3' > > If I give it an explicit unicode codepoint, there isn't the parsing bug, > and so: > > >>> checkBounceUser('10.0.0.1', {'X-Hi': u'\xa3' }, sp=settings.SSO_ID) > name: X-Hi value: £ > repr(name): u'X-Hi' repr(value): u'\xa3' > Another workaround is to avoid using manage.py shell; instead use the plain python shell with DJANGO_SETTINGS_MODULE set in the environment. Karen -- 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...@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.