-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Salt Text Handling of different Line Endings #36502
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
Comments
I want to get a couple more people on this issue to determine how we could move forward these issues because obviously as @lorengordon points out there are multiple issues were this has caused issues. ping @twangboy @terminalmage @cachedout just wanted to get any of your inputs on whether you think there is an easy way for us to handle these situations within salt which we could track here. thanks |
I see the option as
|
From def prepend(path, _args, *_kwargs):
I am adding this here as I suspect this is a general comment as well on handling text files. |
Couple notes:
|
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. |
This is still outstanding |
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. |
Thank you for updating this issue. It is no longer marked as stale. |
I think there's an even higher (lower?) level perspective here that we need to address, and my answer to
is... no. Historically, (python2), bytes and text was conflated. That meant that you could read With Python3, however, text is unicode and bytes are bytes. If you want to treat something as text, you have to explicitly tell Python that it's text. Or that bytes should be bytes. Right now Salt mostly assumes that everything is text/UTF-8, rather than requiring that we're told what kind of thing it is. And in many cases, we don't even allow being told that something isn't text. We just treat it all as text. This fundamental shift in Python2/3 text/bytes separation is great for ensuring that we really have the representation that we expect. But it's also caused a few issues within Salt - and this is one of them. Python, if a file is opened in text mode, will translate The unfortunate part of this problem is that this probably requires a pretty fundamental shift in how Salt thinks about data, and will have an impact throughout the Salt codebase. |
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. |
wow, 30 days? that's a really tight activity window for issues! c'mon @stalebot |
Thank you for updating this issue. It is no longer marked as stale. |
@damon-atkins Is this still an issue on 3006.2? |
Closing this issue due to age and lack of activity. Please test this on version 3006.2 and create a new issue if the problem persists. The new issue template has more information and will allow us to track and reproduce the issue more effectively. Thanks! |
@twangboy I do not believe any code changes have happen to resolve this. Salt does not read a file to find out the line ending it users, or allow the user to indicate which line ending to force use. |
Description of Issue/Question
I will raise this as a separate issue as its bigger than this PR.
There are multiple competing Line Ending Formats:
It's a bad assumptions on Python part that only one type will be on the platform.
Application A on windows may use LF+CR and application B may use LF. Or on Unix you may use salt to generate a file on Unix, which is provide to windows clients using Samba.
Text handling needs to hand all cases on a platform.
Here is an example
C:\salt>salt-call --version
salt-call 2016.3.3 (Boron)
I think this will take a brain trust to decide on a way forward.
The text was updated successfully, but these errors were encountered: