File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -32,6 +32,9 @@ Lib/test/test_importlib/resources/data01/* noeol
3232Lib /test /test_importlib /resources /namespacedata01 /* noeol
3333Lib /test /xmltestdata /* noeol
3434
35+ # Shell scripts should have LF even on Windows because of Cygwin
36+ Lib /venv /scripts /common /activate text eol =lf
37+
3538# CRLF files
3639[attr ]dos text eol =crlf
3740
Original file line number Diff line number Diff line change @@ -611,6 +611,21 @@ def test_zippath_from_non_installed_posix(self):
611611 out , err = check_output (cmd )
612612 self .assertTrue (zip_landmark .encode () in out )
613613
614+ def test_activate_shell_script_has_no_dos_newlines (self ):
615+ """
616+ Test that the `activate` shell script contains no CR LF.
617+ This is relevant for Cygwin, as the Windows build might have
618+ converted line endings accidentally.
619+ """
620+ venv_dir = pathlib .Path (self .env_dir )
621+ rmtree (venv_dir )
622+ [[scripts_dir ], * _ ] = self .ENV_SUBDIRS
623+ script_path = venv_dir / scripts_dir / "activate"
624+ venv .create (venv_dir )
625+ with open (script_path , 'rb' ) as script :
626+ for line in script :
627+ self .assertFalse (line .endswith (b'\r \n ' ), line )
628+
614629@requireVenvCreate
615630class EnsurePipTest (BaseTest ):
616631 """Test venv module installation of pip."""
Original file line number Diff line number Diff line change 1+ Fix virtual environment :file: `activate ` script having incorrect line endings for Cygwin.
You can’t perform that action at this time.
0 commit comments