Skip to content
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

Docker compiler adds extra newline to file content #125

Open
lschulz opened this issue Feb 21, 2023 · 3 comments
Open

Docker compiler adds extra newline to file content #125

lschulz opened this issue Feb 21, 2023 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@lschulz
Copy link
Contributor

lschulz commented Feb 21, 2023

While working on the SCION layer I noticed that the Docker compiler adds an
extra newline to file contents set with Node.setFile().

The problem is in

print(content, file=open(staged_path, 'w'))

The file contents are staged with print which adds a newline at the end of what was printed.

I would suggest changing the line to
print(content, end='', file=open(staged_path, 'w'))
to avoid the newline.

@kevin-w-du kevin-w-du added the bug Something isn't working label Feb 21, 2023
wonkr added a commit that referenced this issue Feb 22, 2023
@wonkr
Copy link
Member

wonkr commented Feb 22, 2023

fixed in Development branch : 0c4282f

@wonkr
Copy link
Member

wonkr commented Feb 22, 2023

Merged into main branch.

@kevin-w-du
Copy link
Member

We revert this change, because the affected function is used in a number of places, some of which probably assume that there is a return at the end. This breaks the emulator. We will look at this issue again and find a better way to address it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants