Opened 8 years ago

Closed 8 years ago

#6650 closed (fixed)

sqlreset should encode UTF-8 back

Reported by: farcaller 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 farcaller 8 years ago.
6650.diff (589 bytes) - added by Simon Greenhill 8 years ago.
updated patch

Download all attachments as: .zip

Change History (5)

Changed 8 years ago by farcaller

comment:1 Changed 8 years ago by farcaller

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

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 8 years ago by Simon Greenhill

updated patch

comment:2 Changed 8 years ago by Simon Greenhill

  • Triage Stage changed from Unreviewed to Ready for checkin

Just tweaked patch to comply to PEP8

comment:3 Changed 8 years ago by russellm

  • Resolution set to fixed
  • Status changed from new to closed

(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