#19749 closed Cleanup/optimization (fixed)
Documentation needed: stdout.write line endings in management commands changed.
Reported by: | Owned by: | nobody | |
---|---|---|---|
Component: | Core (Management commands) | Version: | 1.5-beta-1 |
Severity: | Release blocker | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | yes | UI/UX: | no |
Description
This commit changed the default behavior of stdout.write() for management commands it add "\n" endings unless otherwise specified.
https://github.com/django/django/commit/822d6d6dabc959532fb2904376580e8947c519f6
I haven't seen anything about this in the 1.5 documentation / changes and it requires code changes if you have any sort of output that relies on the old behavior.
Attachments (2)
Change History (11)
comment:1 by , 12 years ago
Needs documentation: | set |
---|
comment:2 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|
comment:3 by , 12 years ago
Severity: | Normal → Release blocker |
---|
by , 12 years ago
Attachment: | 19749-1.diff added |
---|
comment:4 by , 12 years ago
Has patch: | set |
---|---|
Needs documentation: | unset |
comment:5 by , 12 years ago
I don't think it addresses the issue correctly. The fact that newlines are added is part of it, but I had to dig through the code to figure out how to _stop_ having newlines.
self.stdout.write("A message.\n")
still works exactly the same after the change. But self.stdout.write("A message.")
gets a \n tacked on.
The problem for me came because I was using self.stdout.write(".")
to show progress on a single line like a progress bar. I had to replace that with: self.stdout.write(".", ending="")
to fix it.
comment:8 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Does the attached patch seem sufficient?