-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Append/prepend in file.replace assumes '\n' line endings #27368
Comments
@lorengordon, I think choosing the line ending from |
@jfindlay Sometimes I work with Unix files with I think other execution module functions could easily add support for a line separator parameter over time, especially if the logic is separated into a private helper function. I was just referring to a parameter for |
@lorengordon, I think this could become a big, complex change with many unintended consequences. Autodetection may be a better solution in my opinion. I created #23740 and #24089 at the suggestion of @UtahDave to work around some of these issues and it seems to be working so far. |
@jfindlay, this is the other issue I was referring to, regarding line endings. I understand why |
@UtahDave, what is your opinion on this? It seems that |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Handling of line endings still needs a revamp. |
Thank you for updating this issue. It is no longer marked as stale. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
I noticed this while investigating another issue around the append/prepend functionality. The code uses
'\n'
, which is probably not appropriate on Windows. Should probably change that toos.linesep
.https://github.com/saltstack/salt/blob/2015.5/salt/modules/file.py#L1509
Could alternatively add a
linesep
parameter that defaults toos.linesep
, so people can override if they choose?The text was updated successfully, but these errors were encountered: