Skip to content

Commit ae1a179

Browse files
authored
MAINT: Revert 92bb037 (#2961)
Undo PR: 92bb037 According to our deprecation policy, we would have to issue a new major release for that change.
1 parent bd5b962 commit ae1a179

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

pypdf/_doc_common.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
from ._page import PageObject, _VirtualList
5050
from ._page_labels import index2label as page_index2page_label
5151
from ._utils import (
52-
deprecation_with_replacement,
52+
deprecate_with_replacement,
5353
logger_warning,
5454
parse_iso8824_date,
5555
)
@@ -1281,10 +1281,10 @@ def decode_permissions(
12811281
self, permissions_code: int
12821282
) -> Dict[str, bool]: # pragma: no cover
12831283
"""Take the permissions as an integer, return the allowed access."""
1284-
deprecation_with_replacement(
1284+
deprecate_with_replacement(
12851285
old_name="decode_permissions",
12861286
new_name="user_access_permissions",
1287-
removed_in="6.0.0",
1287+
removed_in="5.0.0",
12881288
)
12891289

12901290
permissions_mapping = {

tests/test_reader.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
from pypdf.constants import PageAttributes as PG
1515
from pypdf.constants import UserAccessPermissions as UAP
1616
from pypdf.errors import (
17-
DeprecationError,
1817
EmptyFileError,
1918
FileNotDecryptedError,
2019
PdfReadError,
@@ -746,16 +745,16 @@ def test_decode_permissions():
746745
print_ = base.copy()
747746
print_["print"] = True
748747
with pytest.raises(
749-
DeprecationError,
750-
match="decode_permissions is deprecated and was removed in pypdf 6.0.0. Use user_access_permissions instead",
748+
DeprecationWarning,
749+
match="decode_permissions is deprecated and will be removed in pypdf 5.0.0. Use user_access_permissions instead", # noqa: E501
751750
):
752751
assert reader.decode_permissions(4) == print_
753752

754753
modify = base.copy()
755754
modify["modify"] = True
756755
with pytest.raises(
757-
DeprecationError,
758-
match="decode_permissions is deprecated and was removed in pypdf 6.0.0. Use user_access_permissions instead",
756+
DeprecationWarning,
757+
match="decode_permissions is deprecated and will be removed in pypdf 5.0.0. Use user_access_permissions instead", # noqa: E501
759758
):
760759
assert reader.decode_permissions(8) == modify
761760

0 commit comments

Comments
 (0)