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 #578

Closed
FWuellhorst opened this issue Dec 11, 2024 · 1 comment
Closed

Correctly check file extension in printNumberOfClasses #578

FWuellhorst opened this issue Dec 11, 2024 · 1 comment

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

Closed as this is a duplicate of #579

@mwetter mwetter closed this as completed Dec 11, 2024
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

2 participants