Opened 17 years ago

Closed 16 years ago

#6650 closed (fixed)

sqlreset should encode UTF-8 back

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

Description

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 17 years ago.
6650.diff (589 bytes ) - added by Simon Greenhill 16 years ago.
updated patch

Download all attachments as: .zip

Change History (5)

by Vladimir Pouzanov, 17 years ago

Attachment: sqlreset.patch added

comment:1 by Vladimir Pouzanov, 17 years ago

Currently the problem looks like:

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

by Simon Greenhill, 16 years ago

Attachment: 6650.diff added

updated patch

comment:2 by Simon Greenhill, 16 years ago

Triage Stage: UnreviewedReady for checkin

Just tweaked patch to comply to PEP8

comment:3 by Russell Keith-Magee, 16 years ago

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