Skip to content

Commit e4afc64

Browse files
authored
STY: Use casefold() instead of lower() (#3026)
Also add InteractiveFormDictEntries to PDF_KEYS.
1 parent c358ca5 commit e4afc64

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

pypdf/constants.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -694,12 +694,13 @@ class AnnotationFlag(IntFlag):
694694
DocumentInformationAttributes,
695695
EncryptionDictAttributes,
696696
FieldDictionaryAttributes,
697+
FileSpecificationDictionaryEntries,
697698
FilterTypeAbbreviations,
698699
FilterTypes,
699700
GoToActionArguments,
700701
GraphicsStateParameters,
701702
ImageAttributes,
702-
FileSpecificationDictionaryEntries,
703+
InteractiveFormDictEntries,
703704
LzwFilterParameters,
704705
PageAttributes,
705706
PageLayouts,

tests/test_constants.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,12 @@ def test_slash_prefix():
3030
continue
3131

3232
assert constant_value.startswith("/")
33-
assert attr.replace("_", "").lower() == constant_value[1:].lower()
33+
assert attr.replace("_", "").casefold() == constant_value[1:].casefold()
3434

3535
# There are a few exceptions that may be lowercase
3636
if cls == GraphicsStateParameters and attr in ["ca", "op"]:
3737
continue
38+
3839
assert pattern.match(constant_value)
3940

4041

0 commit comments

Comments
 (0)