[Patch] Trailing blank lines in inital data SQL file break syncdb
If the initial data SQL file for a model has trailing \n's, the sql regex in management.py's get_sql_initial_data_for_model() identifies the trailing \n's as a statement. When syncdb runs this statement (on Postgres - don't know if it affects other databases), it reports a "Failed to install initial SQL" error.
Attachments
(1)
- blanklines.diff
(764 bytes
) - added by Russell Keith-Magee 18 years ago.
- Fixed regex to eliminate blank lines from initial SQL
Download all attachments as:
.zip
Change History
(3)
Component: |
Core framework → django-admin.py
|
Summary: |
Trailing blank lines in inital data SQL file break syncdb → [Patch] Trailing blank lines in inital data SQL file break syncdb
|
Resolution: |
→ fixed
|
Status: |
new → closed
|
Added patch to exclude blank lines from initial data SQL statements.