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

Correctly check file extension in printNumberOfClasses #579

Open
FWuellhorst opened this issue Dec 11, 2024 · 1 comment · Fixed by #580 · May be fixed by #581
Open

Correctly check file extension in printNumberOfClasses #579

FWuellhorst opened this issue Dec 11, 2024 · 1 comment · Fixed by #580 · May be fixed by #581

Comments

@FWuellhorst
Copy link
Contributor

In regressiontest, we had an encoding error during printNumberOfClasses. A .mos file was detected as .mo, as the check is

                    # find .mo files
                    pos = filNam.find('.mo')

which should be

                    if filNam.endswith('.mo') and (root.find('Examples') == -1 or root.find('Validation') == -1):
                        # find classes that are not partial
                        filFulNam = os.path.join(root, filNam)
                        iMod = self._checkKey("model", filFulNam, iMod)
                        iBlo = self._checkKey("block", filFulNam, iBlo)
                        iFun = self._checkKey("function", filFulNam, iFun)

We did not check mos files as the function states it checks models.
Also, the troubleshooting would have been way easier if self._checkKey would just try except the encoded file reading and raise an appropriate error with the file name.
@mwetter do you agree? If so, I can push a fix.

@mwetter
Copy link
Member

mwetter commented Dec 11, 2024

@FWuellhorst : This would be a good fix. Please make a PR.

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