[Django] #21046: django-admin.py always creates files with Unix line endings

14 views
Skip to first unread message

Django

unread,
Sep 5, 2013, 10:55:23 AM9/5/13
to django-...@googlegroups.com
#21046: django-admin.py always creates files with Unix line endings
--------------------------------------------+--------------------
Reporter: Semmel | Owner: nobody
Type: Bug | Status: new
Component: Core (Management commands) | Version: 1.5
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------------------+--------------------
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.

--
Ticket URL: <https://code.djangoproject.com/ticket/21046>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Sep 6, 2013, 3:13:52 AM9/6/13
to django-...@googlegroups.com
#21046: django-admin.py always creates files with Unix line endings
-------------------------------------+-------------------------------------

Reporter: Semmel | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 1.5
commands) | Resolution:
Severity: Normal | Triage Stage:
Keywords: | Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by claudep):

* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0


Comment:

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.

--
Ticket URL: <https://code.djangoproject.com/ticket/21046#comment:1>

Django

unread,
Sep 9, 2013, 10:57:08 AM9/9/13
to django-...@googlegroups.com
#21046: django-admin.py always creates files with Unix line endings
-------------------------------------+-------------------------------------

Reporter: Semmel | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 1.5
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------
Changes (by timo):

* stage: Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/21046#comment:2>

Django

unread,
Sep 12, 2013, 9:48:25 AM9/12/13
to django-...@googlegroups.com
#21046: django-admin.py always creates files with Unix line endings
-------------------------------------+-------------------------------------

Reporter: Semmel | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 1.5
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (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.

--
Ticket URL: <https://code.djangoproject.com/ticket/21046#comment:3>

Django

unread,
Jul 5, 2014, 3:10:33 PM7/5/14
to django-...@googlegroups.com
#21046: django-admin.py always creates files with Unix line endings
-------------------------------------+-------------------------------------

Reporter: Semmel | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 1.5
commands) | Resolution:
Severity: Normal | Triage Stage: Accepted
Keywords: | Needs documentation: 0
Has patch: 0 | Patch needs improvement: 0
Needs tests: 0 | UI/UX: 0
Easy pickings: 0 |
-------------------------------------+-------------------------------------

Comment (by claudep):

I've just attached the patch to test on a non-Unix machine and which might
solve this bug.

--
Ticket URL: <https://code.djangoproject.com/ticket/21046#comment:4>

Django

unread,
Oct 2, 2016, 2:17:23 PM10/2/16
to django-...@googlegroups.com
#21046: django-admin.py always creates files with Unix line endings
-------------------------------------+-------------------------------------
Reporter: Florian Sening | Owner: nobody
Type: Bug | Status: new
Component: Core (Management | Version: 1.5
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Claude Paroz):

* has_patch: 0 => 1


Comment:

[https://github.com/django/django/pull/7334 Pull request]

--
Ticket URL: <https://code.djangoproject.com/ticket/21046#comment:5>

Django

unread,
Oct 4, 2016, 2:24:21 PM10/4/16
to django-...@googlegroups.com
#21046: django-admin.py always creates files with Unix line endings
-------------------------------------+-------------------------------------
Reporter: Florian Sening | Owner: nobody
Type: Bug | Status: new

Component: Core (Management | Version: 1.5
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

I don't know how important this is these days. I think version control
programs like Git usually normalize line endings anyway.

Another consideration (I think) is that this will apply only to Python
files that the template commands are rewriting, not to any other text-
based files.

Does `makemigrations` (and any other management commands that write files)
already have this behavior?

Maybe there are good reasons to make the change, but I just wanted to ask
about these points.

--
Ticket URL: <https://code.djangoproject.com/ticket/21046#comment:6>

Django

unread,
Oct 5, 2016, 4:27:45 AM10/5/16
to django-...@googlegroups.com
#21046: django-admin.py always creates files with Unix line endings
-------------------------------------+-------------------------------------
Reporter: Florian Sening | Owner: nobody
Type: Bug | Status: new

Component: Core (Management | Version: 1.5
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Claude Paroz):

Right, I think Windows user should speak now.

--
Ticket URL: <https://code.djangoproject.com/ticket/21046#comment:7>

Django

unread,
Oct 5, 2016, 9:33:24 AM10/5/16
to django-...@googlegroups.com
#21046: django-admin.py always creates files with Unix line endings
-------------------------------------+-------------------------------------
Reporter: Florian Sening | Owner: nobody
Type: Bug | Status: new

Component: Core (Management | Version: 1.5
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* cc: Ramiro Morales (added)


Comment:

Ramiro, any input?

--
Ticket URL: <https://code.djangoproject.com/ticket/21046#comment:8>

Django

unread,
Oct 12, 2016, 7:43:46 PM10/12/16
to django-...@googlegroups.com
#21046: django-admin.py always creates files with Unix line endings
-------------------------------------+-------------------------------------
Reporter: Florian Sening | Owner: nobody
Type: Bug | Status: new

Component: Core (Management | Version: 1.5
commands) |
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------

Comment (by Tim Graham):

I asked for feedback [https://groups.google.com/d/topic/django-
users/-b6kql_CzYE/discussion on django-users].

--
Ticket URL: <https://code.djangoproject.com/ticket/21046#comment:9>

Django

unread,
Oct 13, 2016, 9:50:28 AM10/13/16
to django-...@googlegroups.com
#21046: django-admin.py always creates files with Unix line endings
-------------------------------------+-------------------------------------
Reporter: Florian Sening | Owner: nobody
Type: Bug | Status: closed

Component: Core (Management | Version: 1.5
commands) |
Severity: Normal | Resolution: wontfix

Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

* status: new => closed
* resolution: => wontfix


Comment:

Feedback from Mike Dewhirst:

I haven't had any such problems. I develop on Windows and deploy on
Linux. Editors and repos look after all that. If I did have a problem I
would consider it my own responsibility to choose a different set of tools
to resolve it. Not a Django issue IMO.

--
Ticket URL: <https://code.djangoproject.com/ticket/21046#comment:10>

Reply all
Reply to author
Forward
0 new messages