commands: adapt convert-to-sql for python3 (#36515)
This commit is contained in:
parent
31cc721510
commit
844dea5853
|
@ -19,6 +19,7 @@ import sys
|
|||
import psycopg2
|
||||
import traceback
|
||||
|
||||
from django.utils.encoding import force_bytes
|
||||
from django.core.management.base import BaseCommand
|
||||
from django.core.management.base import CommandError
|
||||
from django.utils.six import StringIO
|
||||
|
@ -82,7 +83,7 @@ class Command(BaseCommand):
|
|||
options_file = os.path.join(self.publisher.app_dir, 'site-options.cfg')
|
||||
stringio = StringIO()
|
||||
self.publisher.site_options.write(stringio)
|
||||
atomic_write(options_file, stringio.getvalue())
|
||||
atomic_write(options_file, force_bytes(stringio.getvalue()))
|
||||
|
||||
def store_users(self):
|
||||
errors = []
|
||||
|
@ -156,4 +157,4 @@ class Command(BaseCommand):
|
|||
|
||||
def update_progress(self, progress, num_columns=120):
|
||||
sys.stdout.write('[%s] %s%%\r' % (
|
||||
('#'*((num_columns-10)*progress/100)).ljust(num_columns-15), progress))
|
||||
('#'*int((num_columns-10)*progress/100)).ljust(num_columns-15), progress))
|
||||
|
|
Loading…
Reference in New Issue