Skip to content

Csv fixes - #5836

Merged
neersighted merged 3 commits into
python-poetry:masterfrom
dimbleby:csv-fixes
Jun 13, 2022
Merged

neersighted merged 3 commits into
python-poetry:masterfrom
dimbleby:csv-fixes

Conversation

@dimbleby

@dimbleby dimbleby commented Jun 12, 2022 •

Copy link
Copy Markdown
Contributor

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

abn commented Jun 12, 2022

Copy link
Copy Markdown
Member

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

@dimbleby

Copy link
Copy Markdown
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

greschd commented Jun 13, 2022

Copy link
Copy Markdown

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
@github-actions

Copy link
Copy Markdown

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