bagit-python icon indicating copy to clipboard operation
bagit-python copied to clipboard

pass `re.sub` flags as kwargs

Open sneakers-the-rat opened this issue 7 months ago • 0 comments

hello :)

making some bags in testing, getting a DeprecationWarning:

tests/test_validation.py: 81 warnings
  .venv/bin/bagit.py:1412: DeprecationWarning: 'count' is passed as positional argument
    s = re.sub(r"%0D", "\r", s, re.IGNORECASE)

tests/test_validation.py: 81 warnings
  .venv/bin/bagit.py:1413: DeprecationWarning: 'count' is passed as positional argument
    s = re.sub(r"%0A", "\n", s, re.IGNORECASE)

looks like the flags are being interpreted as count, and we're also being warned that we need to pass extra args as kwargs anyway, so fixed that :)

sneakers-the-rat avatar Jun 25 '25 01:06 sneakers-the-rat