Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/bagit/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ def find_locale_dir():

#: Convenience function used everywhere we want to open a file to read text
#: rather than undecoded bytes:
open_text_file = partial(codecs.open, encoding="utf-8", errors="strict")
open_text_file = partial(open, encoding="utf-8", errors="strict")

# This is the same as decoding the byte values in codecs.BOM:
UNICODE_BYTE_ORDER_MARK = "\ufeff"
Expand Down Expand Up @@ -1423,8 +1423,8 @@ def _encode_filename(s):


def _decode_filename(s):
s = re.sub(r"%0D", "\r", s, re.IGNORECASE)
s = re.sub(r"%0A", "\n", s, re.IGNORECASE)
s = re.sub(r"%0D", "\r", s, flags=re.IGNORECASE)
s = re.sub(r"%0A", "\n", s, flags=re.IGNORECASE)
return s


Expand Down