[2.7] bpo-27425: Be more explicit in .gitattributes (GH-840) (GH-2086)

Also updates checked-in line endings in several files.
diff --git a/.gitattributes b/.gitattributes
index 82694d8..d38d0cf 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,8 +1,42 @@
+# Binary data types
+*.aif binary
+*.aifc binary
+*.aiff binary
+*.au binary
+*.bmp binary
+*.db binary
+*.exe binary
+*.icns binary
+*.gif binary
+*.ico binary
+*.jpg binary
 *.pck binary
-Lib/test/cjkencodings/* binary
-Lib/test/decimaltestdata/*.decTest binary
+*.png binary
+*.tar binary
+*.wav binary
+*.whl binary
+*.zip binary
+
+# Specific binary files
 Lib/test/sndhdrdata/sndhdr.* binary
-Lib/test/test_email/data/msg_26.txt binary
-Lib/test/xmltestdata/* binary
-Lib/venv/scripts/nt/* binary
-Lib/test/coding20731.py binary
+
+# Text files that should not be subject to eol conversion
+Lib/test/cjkencodings/* -text
+Lib/test/decimaltestdata/*.decTest -text
+Lib/email/test/data/*.txt -text
+Lib/test/xmltestdata/* -text
+
+# Special files in third party code
+Modules/zlib/zlib.map -text
+
+# CRLF files
+*.bat text eol=crlf
+*.ps1 text eol=crlf
+*.sln text eol=crlf
+*.vcxproj* text eol=crlf
+*.vcproj text eol=crlf
+*.vsprops text eol=crlf
+*.props text eol=crlf
+*.proj text eol=crlf
+PCbuild/readme.txt text eol=crlf
+PC/readme.txt text eol=crlf