Opened 10 years ago

Closed 10 years ago

#6650 closed (fixed)

sqlreset should encode UTF-8 back

Reported by: Vladimir Pouzanov Owned by: nobody
Component: Core (Management commands) Version: master
Severity: Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


sqlreset should encode text string to utf-8 to make it work with UNIX piping, e.g. to |sqlite3 ...

Attachments (2)

sqlreset.patch (547 bytes) - added by Vladimir Pouzanov 10 years ago.
6650.diff (589 bytes) - added by Simon Greenhill 10 years ago.
updated patch

Download all attachments as: .zip

Change History (5)

Changed 10 years ago by Vladimir Pouzanov

Attachment: sqlreset.patch added

comment:1 Changed 10 years ago by Vladimir Pouzanov

Currently the problem looks like:

$ ./ sqlreset news|sqlite3 db/db.sqlite
Traceback (most recent call last):
  File "./", line 11, in <module>
  File "/usr/lib/python2.5/site-packages/django/core/management/", line 272, in execute_manager
  File "/usr/lib/python2.5/site-packages/django/core/management/", line 219, in execute
  File "/usr/lib/python2.5/site-packages/django/core/management/", line 72, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.5/site-packages/django/core/management/", line 93, in execute
    print output
UnicodeEncodeError: 'ascii' codec can't encode characters in position 779-785: ordinal not in range(128)

Changed 10 years ago by Simon Greenhill

Attachment: 6650.diff added

updated patch

comment:2 Changed 10 years ago by Simon Greenhill

Triage Stage: UnreviewedReady for checkin

Just tweaked patch to comply to PEP8

comment:3 Changed 10 years ago by Russell Keith-Magee

Resolution: fixed
Status: newclosed

(In [7706]) Fixed #6650 -- Added UTF-8 encoding to SQL output provided by management commands. Thanks to farcaller for the suggestion.

Note: See TracTickets for help on using tickets.
Back to Top