Code

Opened 8 months ago

Last modified 7 months ago

#21046 new Bug

django-admin.py always creates files with Unix line endings

Reported by: Semmel Owned by: nobody
Component: Core (Management commands) Version: 1.5
Severity: Normal Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Versions prior Django 1.5 created files with machine dependent line endings. With Django 1.5 and above the line endings suddenly changed to always Unix (LF). You can simply check this if you just try startproject and then have a look at the project files.
I could not find anything related to this but I consider this a bug because generated files should be like every other file on your machine - in the native newline format of your platform.

Attachments (0)

Change History (3)

comment:1 Changed 8 months ago by claudep

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

It might be a regression added during fix of #19397 (c9a47fb379cab4c0fe9be27c9924236e75327bd0). I do not have access to non-Unix machines, so I'm not able to test this, but it might be worth testing if only using binary mode when the file is detected as a non text file could solve this issue.

comment:2 Changed 7 months ago by timo

  • Triage Stage changed from Unreviewed to Accepted

comment:3 Changed 7 months ago by Semmel

I think I got it. The fix for #18091 in 3afb5916b215c79e36408b729c9516bc435f5cb7 introduced this bug. Beside that another bug #19397 was introduced which later was fixed in baae4b818778180fedfcfcfc7aa77acfb9b237fb. I still have to figure out how to fix this without breaking the other patches. I'll try your suggestion.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as new
The owner will be changed from nobody to anonymous. Next status will be 'assigned'
as The resolution will be set. Next status will be 'closed'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.