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

Extra row added when saving a csv #57

Open
marberts opened this issue Feb 18, 2023 · 0 comments
Open

Extra row added when saving a csv #57

marberts opened this issue Feb 18, 2023 · 0 comments
Labels
bug Something isn't working

Comments

@marberts
Copy link

Description

Saving a csv prepared with R or pandas adds an extra row at the bottom. That is, a csv like

a,b
1,3
2,4

becomes

a,b
1,3
2,4
,    <-- added

Reproduce

Make a csv with R (or pandas).

Rscript -e "write.csv(data.frame(a = 1:2, b = 3:4), row.names = FALSE, eol = '\r\n')" > test.csv

Then open test.csv in JupyterLab, modify the content of a cell, and save.

Removing the line ending on the last line before opening in JupyterLab seems to fix it, but having a CRLF at the end of the last row is allowed by RFC 4180. That is,

cat -e test.csv

a,b^M$
1,3^M$
2,4^M$

results in an extra line, whereas

cat -e test.csv

a,b^M$
1,3^M$
2,4

works as expected.

Expected behavior

I expect no extra row added when saving a csv.

Context

  • Python package version: 0.6.1
  • Extension version: 0.6.1
  • Operating System and its version: Ubuntu 20.04
  • Browser and its version: Firefox 109.0.1
@marberts marberts added the bug Something isn't working label Feb 18, 2023
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

1 participant