Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Archive::Archive defined twice #2036

Closed
stefan6419846 opened this issue Nov 9, 2022 · 3 comments
Closed

Archive::Archive defined twice #2036

stefan6419846 opened this issue Nov 9, 2022 · 3 comments

Comments

@stefan6419846
Copy link

stefan6419846 commented Nov 9, 2022

Describe the bug

Building the package reports a warning:

swig -python -o fitz/fitz_wrap.c fitz/fitz.i
fitz/fitz.i:12342: Warning 509: Overloaded method Archive::Archive(PyObject *,char const *) effectively ignored,
fitz/fitz.i:12331: Warning 509: as it is shadowed by Archive::Archive(struct Archive *,char const *).
creating build

To Reproduce

Build the wheel.

Expected behavior

No warnings are raised.

Your configuration

  • OpenSUSE Leap 15.3
  • PyMuPDF version 1.21.0, built from PyPI source

Additional context

Looking into the code, both definitions are mostly identical:

PyMuPDF/fitz/fitz.i

Lines 12321 to 12342 in a730bc6

Archive(struct Archive *a0=NULL, const char *path=NULL)
{
fz_archive *arch=NULL;
fz_try(gctx) {
arch = fz_new_multi_archive(gctx);
}
fz_catch(gctx) {
return NULL;
}
return (struct Archive *) arch;
}
Archive(PyObject *a0=NULL, const char *path=NULL)
{
fz_archive *arch=NULL;
fz_try(gctx) {
arch = fz_new_multi_archive(gctx);
}
fz_catch(gctx) {
return NULL;
}
return (struct Archive *) arch;
}

@JorjMcKie
Copy link
Collaborator

Thanks for reporting this. That's no problem, please ignore.

@julian-smith-artifex-com
Copy link
Collaborator

Further to JorjMcKie's comment, the generation of this warning seems to be a known bug in swig.

It can be disabled with swig_opts=['-w509'] in setup.py's call to Extension(); i'll push this workaround shortly.

@julian-smith-artifex-com
Copy link
Collaborator

Fixed in PyMuPDF-1.21.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants