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

Error on audacity 2.4.1 on audacity.cfg read #1

Closed
marlon-sousa opened this issue Jun 13, 2020 · 1 comment
Closed

Error on audacity 2.4.1 on audacity.cfg read #1

marlon-sousa opened this issue Jun 13, 2020 · 1 comment

Comments

@marlon-sousa
Copy link

Hello,

Apparently audacity.cfg is not being parsed correctly on audacity 2.4.1.

I have cleaned my audacity installation and have had errors regarding audacity.cfg read by the addon:

error: cannot read C:\Users[xxx]\AppData\Roaming\audacity\audacity.cfg file
WARNING - external:appModules.audacity.au_applicationSettings.SettingsFileHandler._load (09:13:55.485) - MainThread (5488):

To further debug I added the error description on the corresponding log.warning line in au_applicationSettings.py

Line 85:
log.warning("error: cannot read %s file"%self.filePath)
line 86 (new)
log.debug(f"{e}")

I urge you please to include this line as it would have saved me lots of times when debugging this up front.

Anyways, looking at the log viewer again showed a more interesting error:

Duplicate section name at line 25.

I then went to the audacity.cfg file and checked line 25. Here is what I got:
[MenuBar]

Strangely enough, I looked for menubar because this was the duplicated section. And, in line 3, I found the following:

MenuBar=File,Edit,Select,View,Transport,Tracks,Generate,Effect,Analyze,Tools,Optional,Help

I don't know if this schema is found before 2.4.1, but it seems that there are now ini and conf style keys mixed in the same file
I don't know if ConfigObj can deal with this kind of files either ... apparently not (DiffSK/configobj#135) but I fear that, if we don't find a way to overcome this, your addon won't be usable in current versions of audacity.

A good option would be to set defaults and should errors arise when reading the cfg file just warn the user and user that defaults.

However, consider using another ini parser that is more tolerant.

If you need further help or are whiling to accept pull requests drop me a note and I will try to help.

@paulber19
Copy link
Owner

paulber19 commented Jun 13, 2020 via email

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