{{{
djbaldey@p633m project $ ../manage.py flush
You have requested a flush of the database.
This will IRREVERSIBLY DESTROY all data currently in the u'plx_dev'
database,
and return each table to the state it was in after syncdb.
Are you sure you want to do this?
Type 'yes' to continue, or 'no' to cancel: yes
Traceback (most recent call last):
File "../manage.py", line 60, in <module>
execute_from_command_line(sys.argv)
File "/home/djbaldey/env-django1.6/lib/python2.7/site-
packages/django/core/management/__init__.py", line 399, in
execute_from_command_line
utility.execute()
File "/home/djbaldey/env-django1.6/lib/python2.7/site-
packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/djbaldey/env-django1.6/lib/python2.7/site-
packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/home/djbaldey/env-django1.6/lib/python2.7/site-
packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/home/djbaldey/env-django1.6/lib/python2.7/site-
packages/django/core/management/base.py", line 415, in handle
return self.handle_noargs(**options)
File "/home/djbaldey/env-django1.6/lib/python2.7/site-
packages/django/core/management/commands/flush.py", line 77, in
handle_noargs
"The full error: %s") % (connection.settings_dict['NAME'], e)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 0:
ordinal not in range(128)
}}}
Patch in django/core/management/commands/flush.py:
{{{
from django.utils.encoding import smart_text
...
"The full error: %s") % (connection.settings_dict['NAME'], smart_text(e))
...
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22882>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_docs: => 0
* needs_tests: => 0
* stage: Unreviewed => Accepted
Comment:
#20572 is related.
--
Ticket URL: <https://code.djangoproject.com/ticket/22882#comment:1>
Comment (by djbaldey):
UPD: in command dumpdata
{{{
djbaldey@p633m project $ ../manage.py dumpdata users
[Traceback (most recent call last):
File "../manage.py", line 60, in <module>
execute_from_command_line(sys.argv)
File "/home/djbaldey/env-django1.6/lib/python2.7/site-
packages/django/core/management/__init__.py", line 399, in
execute_from_command_line
utility.execute()
File "/home/djbaldey/env-django1.6/lib/python2.7/site-
packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/djbaldey/env-django1.6/lib/python2.7/site-
packages/django/core/management/base.py", line 249, in run_from_argv
stderr.write('%s: %s' % (e.__class__.__name__, force_str(e)))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xd0 in position 30:
ordinal not in range(128)
}}}
Patch in django/core/management/commands/base.py:
{{{
from django.utils.encoding import force_str, smart_text
...
stderr.write('%s: %s' % (e.__class__.__name__, smart_text(e)))
...
}}}
After:
{{{
djbaldey@p633m project $ ../manage.py dumpdata users
CommandError: Unable to serialize database: ОШИБКА: отношение
"users_permission" не существует
LINE 1: ...."built_type", "users_permission"."codename" FROM "users_per...
^
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22882#comment:2>
* component: Uncategorized => Core (Management commands)
--
Ticket URL: <https://code.djangoproject.com/ticket/22882#comment:3>
* owner: nobody => fcurella
* status: new => assigned
--
Ticket URL: <https://code.djangoproject.com/ticket/22882#comment:4>
* has_patch: 0 => 1
* version: 1.6 => master
* needs_tests: 0 => 1
Comment:
I've taken the liberty to create a PR implementing the fixes mentioned in
the description
https://github.com/django/django/pull/3172
--
Ticket URL: <https://code.djangoproject.com/ticket/22882#comment:5>
* status: assigned => closed
* resolution: => fixed
Comment:
In [changeset:"0e4d79c4f0591da3d2b0cf030cb8a79abe482345"]:
{{{
#!CommitTicketReference repository=""
revision="0e4d79c4f0591da3d2b0cf030cb8a79abe482345"
Fixed #22882 -- Fixed a UnicodeDecodeError in flush.
Thanks djbaldey for the report.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22882#comment:6>
Comment (by Tim Graham <timograham@…>):
In [changeset:"a932c596fc5bfcfcb358981540917c8d6f9dc575"]:
{{{
#!CommitTicketReference repository=""
revision="a932c596fc5bfcfcb358981540917c8d6f9dc575"
[1.7.x] Fixed #22882 -- Fixed a UnicodeDecodeError in flush.
Thanks djbaldey for the report.
Backport of 0e4d79c4f0 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/22882#comment:7>