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

Bug in __init()__ #1100

Open
martinowitsch opened this issue Jan 16, 2024 · 6 comments
Open

Bug in __init()__ #1100

martinowitsch opened this issue Jan 16, 2024 · 6 comments

Comments

@martinowitsch
Copy link

There seems to be a bug in line 41 in the __init()__.py file.

The join() function will crash:
raise RuntimeError("Blosc2 library not found. " f"I looked for \"{', '.join(blosc2_search_paths)}\"")

If the list blosc2_search_paths conatins a 'None', i.e.:
['libblosc2.dll', 'c:\Somewhere\libblosc2.dll', None]

Traceback (most recent call last):
  File "c:\IniTest.py", line 34, in <module>
    f"I looked for \"{', '.join(blosc2_search_paths)}\"")
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: sequence item 2: expected str instance, NoneType found

This may happen, when the list is generated in line 27:

blosc2_search_paths = [blosc2_lib_hardcoded,
                       os.path.join(current_dir, blosc2_lib_hardcoded),
                       find_library("blosc2")]

And the function find_library("blosc2") returns 'None' if no lib was found.

I've encountered this error while generating an executable via PyInstaller and forgot to link the libblosc2.dll.

@avalentino
Copy link
Member

Dear @martinowitsch
thanks a lot for reporting.
It seems that you made already a very good analysis!
Would you like to submit a PR to fix this issue?

@martinowitsch
Copy link
Author

Sure, however since I am new to git, whats a PR? 😄
I would propose to typecast the return value of find_library("blosc2") call in line 43:
str(find_library("blosc2"))

@avalentino
Copy link
Member

Thanks @martinowitsch
PRs are Pull Requests
It is the common way to propose changes to project managed by other people.
The workflow is quite simple:

  • you fork the repository for which you want to propose a change
  • in the forked repository you create a dedicated git branch
  • edit the code to implement the changes you with
  • commit and publish the code on your fork
  • create the pull request using the button that appears in the GitHub web interface (in your fork)

Once the PR is created the rest suite is automatically run
At this stage we can check and approve you changes vefore merging into the main project.

Please let me know if you need more assistance.

@RitikaxShakya
Copy link

May I know if this issue is taken? if not may i take this issue?

@avalentino
Copy link
Member

Hi @RitikaxShakya
you are more than welcome to take in charge this issue.
Thanks a lot

@RitikaxShakya
Copy link

Yes i would like to pick this issue.

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

No branches or pull requests

3 participants