1. Martin von Löwis
  2. django-3k-old


Martin von Löwis  committed 0d79002

Open SQL files in binary+universal-readlines mode.
XXX for 3.x, it would be better to open them in text mode with the desired encoding.

  • Participants
  • Parent commits 1800331
  • Branches default

Comments (0)

Files changed (1)

File django/core/management/sql.py

View file
                  os.path.join(app_dir, "%s.sql" % opts.object_name.lower())]
     for sql_file in sql_files:
         if os.path.exists(sql_file):
-            fp = open(sql_file, 'U')
+            fp = open(sql_file, 'rbU')
             for statement in statements.split(fp.read().decode(settings.FILE_CHARSET)):
                 # Remove any comments from the file
                 statement = re.sub(ur"--.*([\n\Z]|$)", "", statement)