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
Add .bat line to .hgeol #61404
Comments
Most times (though not all, for some reason) I try to use Doc\make.bat update, it fails with "The system cannot find the batch label specified - update" even though it is obviously there. The reason for this appears to be the fact that the file uses UNIX line endings[1]. As a fix, I think it would make the most sense to add a "**.bat = CRLF" line to .hgeol. The attached patch makes that change and includes the changes that that change entails. The complete list of affected files is as follows: Doc\make.bat As far as I know, there is no reason to believe that the changes to line endings in these files would cause any change to behavior other than possibly avoid strange and random bugs in their execution, particularly in Doc\make.bat. If we don't want to a blanket rule like this, I think we should at least add a rule for Doc\make.bat to convert it to CRLF line endings to avoid the bug with :update. Thanks, Zach |
**.bat used to be there, but it was removed in 1762d79eab65. I have a very faint memory of some discussion about bat files and EOLs, but the best I could find was: This seems to suggest that CRLF shouldn't be necessary. There's also an older discussion about adding CRLF for make.bat here (the discussion is actually somewhat unrelated, but back then adding these entries sounded like a good idea): http://mail.python.org/pipermail/python-committers/2011-May/001685.html |
It's not necessary on .bat files without labels, but those with labels are subject to the (Windows) bug described in my first message and link. Adding an entry specifically for Doc/make.bat and any other batch scripts with labels would be fine as well. |
I have recently learned why this issue had seemed transient to me previously: the hg eol extension apparently causes hg to create all files that are not explicitly set to LF or BIN using CRLF on Windows. Thus, this is what happens: """ P:\Python\cpython\Doc>make.bat update P:\Python\cpython\Doc>cd .. P:\Python\cpython>hg up null P:\Python\cpython>hg --config extensions.eol= up default P:\Python\cpython>cd Doc P:\Python\cpython\Doc>make.bat update P:\Python\cpython\Doc> Thus, a usable workaround is to enable the eol extension in hgrc and make your checkout that way. However, this doesn't help anyone who is trying to build from a tarball; Doc/make.bat will have LF line endings and at least 'update' will not work. Perhaps a less extensive change would be to add "**.bat = BIN", and then convert Doc/make.bat to CRLF explicitly? |
Zachary: What Windows version do you use? Glen Linderman claims that at least Windows 7 should work fine with cmd files containing only LF, and suggested that this may also be the case on Windows XP. Are you using a non-standard command interpreter by any chance? |
I'm on 32 bit Windows 7 Pro, SP1, and have also reproduced the issue on 64 bit Windows 7 Home Premium, SP1. I use the standard Command Prompt (cmd.exe) on both. |
I'm running Win7 and have the same problem, with a fresh checkout and the eol extension disabled. The attached (updated) patch does solve the issue. I can't see any reason not to apply it, even if it's not needed in many cases. |
Any objections to proceeding with this? |
No objections so proceeding is in order here I take it? |
New changeset 019c17a4198a by Zachary Ware in branch '2.7': New changeset 640ccb924b5f by Zachary Ware in branch '3.4': New changeset 9b2ea49213fd by Zachary Ware in branch 'default': |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: