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 phobos/core/multiple.py #363

Closed
m0rsch1 opened this issue May 31, 2024 · 8 comments
Closed

Bug in phobos/core/multiple.py #363

m0rsch1 opened this issue May 31, 2024 · 8 comments
Assignees
Labels
merge requested Feature waiting for merge by developers.

Comments

@m0rsch1
Copy link
Contributor

m0rsch1 commented May 31, 2024

self.inputfile = os.path.abspath(inputfile)

The inputfile can be None but is not checked before calling os.path.abspath(inputfile)

@AlpenAalAlex
Copy link
Collaborator

Can you give me the python traceback to this error?

@m0rsch1
Copy link
Contributor Author

m0rsch1 commented Jun 7, 2024

Well, i dont have a trace right now. But i think its not needed here: If i pass no inputfile to the __init__ function of the Arrangement class, then it is set to None per default. In that case the line i have highlighted will fail, because os.path.abspath(None) is an invalid call.

@m0rsch1
Copy link
Contributor Author

m0rsch1 commented Jun 7, 2024

So, either the inputfile argument is needed, then it should not be set to None per default or (which i think has been intended) the self.inputfile attribute has to be initialized to None as well and overwritten only if the argument inputfile is not None (there is an if statement for that already later in the __init__ constructor).

@AlpenAalAlex AlpenAalAlex self-assigned this Jun 10, 2024
@hwiedPro
Copy link
Collaborator

Please check with pre_v2.1.0 ;)

@hwiedPro hwiedPro mentioned this issue Jun 13, 2024
9 tasks
@m0rsch1
Copy link
Contributor Author

m0rsch1 commented Jun 14, 2024

After a quick look into the affected file i dont see this bug fixed there.

hwiedPro added a commit that referenced this issue Jun 14, 2024
@hwiedPro
Copy link
Collaborator

But now it is;)

@AlpenAalAlex AlpenAalAlex added the merge requested Feature waiting for merge by developers. label Jul 8, 2024
@m0rsch1
Copy link
Contributor Author

m0rsch1 commented Aug 22, 2024

Found another similar issue here:

--- a/phobos/core/multiple.py
+++ b/phobos/core/multiple.py
@@ -22,7 +22,7 @@ class Entity(Representation, SmurfBase):
         assert world is not None
         self.model = _singular(model)
         self.origin = _singular(origin) if origin is not None else representation.Pose()
-        self._file = os.path.normpath(os.path.join(os.path.dirname(world.inputfile), file)) if not os.path.isabs(file) else file
+        self._file = os.path.normpath(os.path.join(os.path.dirname(world.inputfile), file)) if file is not None and not os.path.isabs(file) else file
         if model is None and file is not None:
             if self._file.lower().rsplit(".", 1)[-1] in ["smurfs", "smurfa"]:
                 try:

AlpenAalAlex added a commit to AlpenAalAlex/phobos that referenced this issue Aug 22, 2024
@m0rsch1
Copy link
Contributor Author

m0rsch1 commented Sep 2, 2024

Has been fixed, thank you :)

@m0rsch1 m0rsch1 closed this as completed Sep 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge requested Feature waiting for merge by developers.
Projects
None yet
Development

No branches or pull requests

3 participants