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

python regression #6964

Closed
tpaviot opened this issue Oct 27, 2023 · 3 comments
Closed

python regression #6964

tpaviot opened this issue Oct 27, 2023 · 3 comments

Comments

@tpaviot
Copy link

tpaviot commented Oct 27, 2023

commit d5fe4b0 introduces a regression in codebase (ubuntu-22.04/py3.9):

  File "[...]/z3/__init__.py", line 1, in <module>
    from .z3 import *
  File "[...]/z3/z3.py", line 46, in <module>
    from . import z3core
  File "[...]/z3/z3core.py", line 15, in <module>
    _z3_lib_resource = importlib_resources.files('z3', 'lib')
  File "[...]/importlib_resources/_common.py", line 37, in wrapper
    return func(anchor, package)
TypeError: files() takes from 0 to 1 positional arguments but 2 were given

ping @rsetaluri

@NikolajBjorner
Copy link
Contributor

So is it?

from importlib_resources import files

def resource_filename(package_or_requirement, resource_name):
    return str(files(package_or_requirement) / resource_name)

# usage
resource_filename('z3', 'lib')

@rsetaluri
Copy link
Contributor

Yes I think @NikolajBjorner's solution is correct. We need to do files('z3').joinpath('lib')

NikolajBjorner added a commit that referenced this issue Oct 27, 2023
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
@tpaviot
Copy link
Author

tpaviot commented Oct 28, 2023

👍

@tpaviot tpaviot closed this as completed Oct 28, 2023
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