Changes between Version 1 and Version 2 of Ticket #26731, comment 3


Ignore:
Timestamp:
Jun 8, 2016, 3:27:06 PM (9 years ago)
Author:
Darren Hobbs

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #26731, comment 3

    v1 v2  
    11The string came from the db. The actual error came from django/core/management/base.py", line 111, in write.
    22
    3 I fixed my specific issue by importing unicode literals and using `self.stdout.write('{}'.format(unicode_string))`. I'm afraid my understanding of python's unicode string handling isn't great. Perhaps the answer is to update the documentation to suggest using unicode literals in management commands - the alternative is a nasty surprise waiting to happen in production (as it did to me!)
     3I fixed my specific issue by importing unicode literals and using `self.stdout.write('{}'.format(possibly_unicode_string_from_db))`. I'm afraid my understanding of python's unicode string handling isn't great. Perhaps the answer is to update the documentation to suggest using unicode literals in management commands - the alternative is a nasty surprise waiting to happen in production (as it did to me!)
Back to Top