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

Incorrect Early Return in get_opf_path Method in OpenPechaGitRepo Class #269

Open
gangagyatso4364 opened this issue Jan 9, 2024 · 0 comments · May be fixed by #270
Open

Incorrect Early Return in get_opf_path Method in OpenPechaGitRepo Class #269

gangagyatso4364 opened this issue Jan 9, 2024 · 0 comments · May be fixed by #270

Comments

@gangagyatso4364
Copy link

Describe the bug
There's a bug in the get_opf_path method of the OpenPechaGitRepo class where the method prematurely returns the OPF path after calling the download_pecha function. This behavior can lead to other functions and properties trying to access a file that is not the correct OPF path, causing potential file not found errors or incorrect file handling.

To Reproduce
Steps to reproduce the behavior:

  1. Initialize an instance of OpenPechaGitRepo with a valid pecha_id and without a path.
  2. The get_opf_path method is invoked during initialization.
  3. The method calls download_pecha(pecha_id)
  4. The method returns a path that is not the correct OPF path.

Expected behavior
The expected behavior is that the get_opf_path method should correctly handle the scenario where a pecha is being downloaded and the correct opf path is returned. It should ensure that the path returned is the correct OPF path after the download is complete.

Screenshots
the code can be changed to this.
Screenshot from 2024-01-08 16-51-14

Desktop (please complete the following information):

  • OS: [e.g. iOS]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
in the following function an OpenPechaGitRepo object is created. here the property opf.base_names_list is showing an error becuase it is misguided to the pecha folder instead of opf folder because premature return of opf path value.
code:
Screenshot from 2024-01-09 12-29-06

error message:
An error occurred while processing Pecha ID I229815A9: [Errno 2] No such file or directory: '/home/gangagyatso/.openpecha/pechas/I229815A9/base'

@gangagyatso4364 gangagyatso4364 linked a pull request Jan 9, 2024 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant