bpo-11594: Ensure line-endings are respected when using 2to3#6483
Conversation
|
Looks good to me! |
Sorry, something went wrong.
|
Can you add a news file also? |
Sorry, something went wrong.
|
@ambv Thank you for taking the time for reviewing this patch. I didn't refactor it exactly the way you told me to because I felt it was too much "extracting the similarities just for the sake of keeping the code DRY". Instead, I extracted certain functionality, "initializing the test file" and "reading the test file", into separate functions |
Sorry, something went wrong.
|
Much better. Thanks! |
Sorry, something went wrong.
|
Sorry, @aaronang and @ambv, I could not cleanly backport this to |
Sorry, something went wrong.
|
@aaronang Did this not make the 3.7.0 release? I'm seeing my line endings being changed from CRLF to CRCRLF (yikes!) on Windows. Or perhaps that's a different issue? |
Sorry, something went wrong.
|
According to the news file, this PR was included in 3.7.0b4. Sounds like you may have identified a new issue. |
Sorry, something went wrong.
|
@jaraco Good to know. All tests passed on my Windows PC. Could you add a test case for CRLF files on Windows? I don't know if the automated tests are run against Windows but I could run it manually if needed. |
Sorry, something went wrong.
|
@aaronang I think I see where things went wrong. In adding I think the patch also needs something like: |
Sorry, something went wrong.
|
I am sorry for the late reply. I am looking into it now. |
Sorry, something went wrong.
|
@blah238 Could you apply this patch to the master: And run: For me this doesn't fail locally. |
Sorry, something went wrong.
|
@aaronang to be clear, when the test didn't fail, did you run it on Windows? I didn't run the test suite, but I did verify the behavior on a Windows machine. |
Sorry, something went wrong.
|
@jaraco I am sorry for being unclear. I don't have a Windows machine so I couldn't test whether the test with the patch (that you proposed) fails or not on Windows. |
Sorry, something went wrong.
|
@jaraco I am sorry for asking this but could you test out the patch that you proposed to see if it fixes the problem? I am not really capable of fixing the problem because I don't have a Windows machine available. I am a bit embarrassed for asking this 😓 |
Sorry, something went wrong.
|
I’m pretty sure this is the right fix. I’ll submit a PR with just the test update to demonstrate the failure then apply the fix. |
Sorry, something went wrong.
|
@jaraco I really wanted to help out but don't have a Windows machine available. Thanks a lot! |
Sorry, something went wrong.
|
@blah238 - The fix should come in 3.7.1, but feel free to grab the latest refactor.py from the Python 3.7 branch and replace it in your installation. |
Sorry, something went wrong.
Sorry, something went wrong.
https://bugs.python.org/issue11594