Merge pull request #257 from cjmayo/startexp

Replace deprecated regexp flags not at start
This commit is contained in:
anarcat 2019-04-27 13:26:59 -04:00 committed by GitHub
commit d022ad49ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -25,7 +25,7 @@ except ImportError:
has_sqlite = False
extension = re.compile(r'/(?i)places.sqlite$')
extension = re.compile(r'/places.sqlite$', re.IGNORECASE)
# Windows filename encoding

View file

@ -52,12 +52,12 @@ def add_mimetype(mimedb, mimetype, extension):
# if file extension lookup was unsuccessful, look at the content
PARSE_CONTENTS = {
"text/html": re.compile(r'^(?i)<(!DOCTYPE html|html|head|title)'),
"text/html": re.compile(r'^<(!DOCTYPE html|html|head|title)', re.IGNORECASE),
"text/plain+opera": re.compile(r'^Opera Hotlist'),
"text/plain+chromium": re.compile(r'^{\s*"checksum":'),
"text/plain+linkchecker": re.compile(r'(?i)^# LinkChecker URL list'),
"text/plain+linkchecker": re.compile(r'^# LinkChecker URL list', re.IGNORECASE),
"application/xml+sitemapindex": re.compile(r'(?i)<\?xml[^<]+<sitemapindex\s+'),
"application/xml+sitemap": re.compile(r'(?i)<\?xml[^<]+<urlset\s+'),
"application/xml+sitemap": re.compile(r'<\?xml[^<]+<urlset\s+', re.IGNORECASE),
}
def guess_mimetype (filename, read=None):