Django

Code

Ticket #6650 (closed: fixed)

Opened 10 months ago

Last modified 6 months ago

sqlreset should encode UTF-8 back

Reported by: farcaller Assigned to: nobody
Milestone: Component: django-admin.py
Version: SVN Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: 1 Needs documentation: 0
Needs tests: 0 Patch needs improvement: 0

Description

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

Attachments

sqlreset.patch (0.5 kB) - added by farcaller on 02/23/08 07:52:06.
6650.diff (0.6 kB) - added by Simon Greenhill on 06/14/08 01:42:02.
updated patch

Change History

02/23/08 07:52:06 changed by farcaller

  • attachment sqlreset.patch added.

02/23/08 07:53:36 changed by farcaller

  • needs_better_patch changed.
  • needs_tests changed.
  • needs_docs changed.

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)

06/14/08 01:42:02 changed by Simon Greenhill

  • attachment 6650.diff added.

updated patch

06/14/08 01:42:23 changed by Simon Greenhill

  • stage changed from Unreviewed to Ready for checkin.

Just tweaked patch to comply to PEP8

06/19/08 09:38:57 changed by russellm

  • status changed from new to closed.
  • resolution set to fixed.

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


Add/Change #6650 (sqlreset should encode UTF-8 back)




Change Properties
Action