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

Csv fixes #5836

Merged
merged 3 commits into from
Jun 13, 2022
Merged

Csv fixes #5836

merged 3 commits into from
Jun 13, 2022

Conversation

dimbleby
Copy link
Contributor

@dimbleby dimbleby commented Jun 12, 2022

Some fixes for handling the csv RECORD file

First, open the file with newline="". Per https://docs.python.org/3/library/csv.html#id3

If newline='' is not specified, newlines embedded inside quoted fields will not be interpreted correctly, and on platforms that use \r\n linendings on write an extra \r will be added

I'm almost sure this will fix #5799, although since I don't have a Windows environment of my own I can't prove it.

Then while I was there I noticed that poetry really ought to use csv in the other place that it creates this file, to make sure that escaping of funny filenames and suchlike happens properly. cf python-poetry/poetry-core#61

@abn
Copy link
Member

abn commented Jun 12, 2022

@dimbleby any chance we can add a simple test somewhere for this to ensure we do not regress?

@dimbleby
Copy link
Contributor Author

tweaked some unit test. In particular the assertion that all entries are of length 3 ought to catch #5799 (though I don't have a suitable environment to confirm that this failed without the fix)

@dimbleby dimbleby force-pushed the csv-fixes branch 2 times, most recently from 4ed49b7 to 4c026d5 Compare June 12, 2022 21:15
@neersighted neersighted merged commit 79694ae into python-poetry:master Jun 13, 2022
@dimbleby dimbleby deleted the csv-fixes branch June 13, 2022 07:51
@greschd
Copy link

greschd commented Jun 13, 2022

Wow, that was a quick turnaround! I can confirm that this fixes the RECORD issue on Windows, the repro I had made runs clean when using the latest git version of poetry. Thanks for all your work on poetry! 🎉

@mkniewallner mkniewallner mentioned this pull request Jul 12, 2022
Copy link

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 29, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Empty line in RECORD for git dependency, fails on uninstall
4 participants