Opened 17 years ago

Last modified 12 years ago

#6849 closed

UnicodeEncodeError thrown when unicode messages were sent to outlog&errlog — at Version 3

Reported by: feisan Owned by: nobody
Component: Core (Other) Version: dev
Severity: Normal Keywords: outlog errlog runfcgi unicode
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no

Description (last modified by Ramiro Morales)

pythin manage.py runfcgi --settings=settings \
  maxchildren=20 maxspare=10 minspare=2 \
  outlog=xxx.out \
  errlog=xxx.err

and the view code is

def someview(request):
  print u'\u6d4b\u8bd5' #should be sent to outlog, but the UnicodeEncodeError thrown 

Change History (4)

by Karen Tracey <kmtracey@…>, 17 years ago

Attachment: 6849.diff added

comment:1 by Karen Tracey <kmtracey@…>, 17 years ago

That's because the files opened by become_daemon don't have any support for writing unicode to them. You could try the patch I uploaded (I'm not set up to run in this config.) It opens the files specifying they should be utf-8 encoded. Not sure if it should be hardcoded to that or use a setting, but first off maybe someone should test that the approach even works.

comment:2 by Simon Greenhill, 16 years ago

Has patch: set
Patch needs improvement: set
Triage Stage: UnreviewedAccepted

comment:3 by Ramiro Morales, 16 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top