#2729 closed defect (fixed)
[patch] sqlinitialdata files with dos line endings error out on Gnu/Linux
Reported by: | Joeboy | Owned by: | Adrian Holovaty |
---|---|---|---|
Component: | Database layer (models, ORM) | Version: | dev |
Severity: | normal | Keywords: | sqlinitialdata dos windows |
Cc: | django25@…, dev@… | Triage Stage: | Unreviewed |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
On my Gnu/Linux box, trying to use sqlinitialdata files provided by my windows-using colleagues, I get:
joe@edward ~/reportlab/libs/rltravelprod/djtravel $ ./manage.py reset holidays You have requested a database reset. This will IRREVERSIBLY DESTROY any data in your database. Are you sure you want to do this? Type 'yes' to continue, or 'no' to cancel: yes Error: holidays couldn't be installed. Possible reasons: * The database isn't running or isn't configured correctly. * At least one of the database tables already exists. * The SQL was invalid. Hint: Look at the output of 'django-admin.py sqlreset holidays'. That's the SQL this command wasn't able to run. The full error: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ';\r\nINSERT INTO `holidays_resort` (id, name, region_id) VALUES (2,'Cavtat',1);\r\nI' at line 1")
Converting to unix line endings fixes it.
Attachments (2)
Change History (5)
by , 18 years ago
Attachment: | resort.sql added |
---|
comment:1 by , 18 years ago
Cc: | added |
---|
comment:2 by , 18 years ago
Cc: | added |
---|---|
Summary: | sqlinitialdata files with dos line endings error out on Gnu/Linux → [patch] sqlinitialdata files with dos line endings error out on Gnu/Linux |
Hmm... using python's "U" mode when reading the file in should fix this by standardising line breaks. I've had a go at this (patch attached), but given that I'm on OSX, I'm not sure that I'm replicating the problem exactly.
by , 18 years ago
comment:3 by , 18 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
sample erroring dos file