-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Description
warnings.warn
is currently not being used in a consistent manner:
- There is
pypdf._utils.deprecate
andpypdf._utils.deprecation
, but some places use plainwarnings.warn
with theDeprecationWarning
category.Lines 274 to 278 in 908797f
warnings.warn( "The parameter 'ido' is depreciated and will be removed in " "pypdf 4.0.0.", DeprecationWarning, ) Lines 1286 to 1290 in 908797f
warnings.warn( "Please use 'user_password' instead of 'user_pwd'. " "The 'user_pwd' argument is deprecated and " "will be removed in pypdf 4.0.0." ) Lines 1305 to 1311 in 908797f
warnings.warn( message=( f"{old_term} is deprecated as an argument and will be " f"removed in pypdf 4.0.0. Use {new_term} instead" ), category=DeprecationWarning, ) Lines 1745 to 1751 in 908797f
warnings.warn( message=( f"{old_term} is deprecated as an argument and will be " f"removed in pypdf 4.0.0. Use {new_term} instead" ), category=DeprecationWarning, ) Lines 2038 to 2044 in 908797f
warnings.warn( message=( f"{old_term} is deprecated as an argument and will be " f"removed in pypdf 4.0.0. Use {new_term} instead" ), category=DeprecationWarning, ) Lines 2083 to 2089 in 908797f
warnings.warn( message=( f"{old_term} is deprecated as an argument and will be " f"removed in pypdf 4.0.0. Use {new_term} instead" ), category=DeprecationWarning, ) Lines 2321 to 2325 in 908797f
warnings.warn( "The 'ignore_byte_string_object' argument of remove_images is " "deprecated and will be removed in pypdf 4.0.0.", category=DeprecationWarning, ) Lines 2363 to 2367 in 908797f
warnings.warn( "The 'ignore_byte_string_object' argument of remove_images is " "deprecated and will be removed in pypdf 4.0.0.", category=DeprecationWarning, ) Lines 2405 to 2409 in 908797f
warnings.warn( "The 'pagenum' argument of add_uri is deprecated and will be " "removed in pypdf 4.0.0. Use 'page_number' instead.", category=DeprecationWarning, ) Lines 361 to 367 in 908797f
warnings.warn( ( "indirect_ref is deprecated and will be removed in " "pypdf 4.0.0. Use indirect_reference instead of indirect_ref." ), DeprecationWarning, ) Lines 375 to 381 in 908797f
warnings.warn( ( "indirect_ref is deprecated and will be removed in pypdf 4.0.0" "Use indirect_reference instead of indirect_ref." ), DeprecationWarning, ) Lines 2281 to 2284 in 908797f
warnings.warn( "parameters Tj_Sep, TJ_sep depreciated, and will be removed in pypdf 4.0.0.", DeprecationWarning, ) Lines 163 to 169 in 908797f
warnings.warn( ( f"{old_term} is deprecated as an argument and will be " f"removed in pypdf=4.0.0. Use {new_term} instead" ), DeprecationWarning, ) Lines 702 to 708 in 908797f
warnings.warn( ( f"{old_term} is deprecated as an argument and will be " f"removed in pypdf==4.0.0. Use {new_term} instead" ), DeprecationWarning, ) Lines 809 to 815 in 908797f
warnings.warn( ( f"{old_term} is deprecated as an argument and will be " f"removed in pypdf==4.0.0. Use {new_term} instead" ), DeprecationWarning, )
- There are some plain
warnings.warn
with a different category. I am not sure whether they are eligble for converting them tologger_warning
instead as there is not much which can be done on the user side anyway (besides submitting a PR to implement it ;)):
I would like to see this harmonized and I am open to submit a corresponding PR for this.