File tree 3 files changed +19
-0
lines changed
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
32
32
Lib /test /test_importlib /resources /namespacedata01 /* noeol
33
33
Lib /test /xmltestdata /* noeol
34
34
35
+ # Shell scripts should have LF even on Windows because of Cygwin
36
+ Lib /venv /scripts /common /activate text eol =lf
37
+
35
38
# CRLF files
36
39
[attr ]dos text eol =crlf
37
40
Original file line number Diff line number Diff line change @@ -611,6 +611,21 @@ def test_zippath_from_non_installed_posix(self):
611
611
out , err = check_output (cmd )
612
612
self .assertTrue (zip_landmark .encode () in out )
613
613
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
+
614
629
@requireVenvCreate
615
630
class EnsurePipTest (BaseTest ):
616
631
"""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