9797
9898# readme.txt and changelog.txt can have translations. This can be with the
9999# first part of the ISO code, or with the full. For example:
100- # readme.txt, readme_nl.txt, readme_nl_NL.txt
100+ # readme.txt, readme_nl.txt, readme_nl_NL.txt, readme.md
101101# All other variantions are not valid.
102- txt_regexp = re .compile (r"(readme|changelog)(_[a-z]{2}(_[A-Z]{2})?)?\.txt$" )
102+ txt_regexp = re .compile (r"(readme|changelog)(_[a-z]{2}(_[A-Z]{2})?)?\.( txt|md) $" )
103103
104104
105105def _validate_textfile_encoding (fp ):
@@ -111,14 +111,14 @@ def _validate_textfile_encoding(fp):
111111
112112def _read_object (filename , fp ):
113113 lfilename = filename .lower ()
114- if lfilename . endswith ( " .txt" ):
115- if filename == "license.txt" :
116- _validate_textfile_encoding ( fp )
117- return None
118- elif txt_regexp . match ( filename ):
119- _validate_textfile_encoding ( fp )
120- return None
121- elif filename .startswith ("lang/" ):
114+ if filename in ( "license .txt" , "license.md " ):
115+ _validate_textfile_encoding ( fp )
116+ return None
117+ elif txt_regexp . match ( filename ):
118+ _validate_textfile_encoding ( fp )
119+ return None
120+ elif lfilename . endswith ( ".txt" ):
121+ if filename .startswith ("lang/" ):
122122 _validate_textfile_encoding (fp )
123123 return None
124124 else :
0 commit comments