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

configparser.MissingSectionHeaderError: File contains no section headers. #1

Closed
m-primo opened this issue Jun 6, 2021 · 0 comments
Closed

Comments

@m-primo
Copy link
Owner

m-primo commented Jun 6, 2021

Traceback (most recent call last):
  File "app.py", line 220, in <module>
    main()
  File "app.py", line 204, in main
    login_from_config()
  File "app.py", line 191, in login_from_config
    fb_login(get_config(configPath))
  File "app.py", line 186, in get_config
    configObj.read(configPath)
  File "D:\Software\Program Files\Python\lib\configparser.py", line 697, in read
    self._read(fp, filename)
  File "D:\Software\Program Files\Python\lib\configparser.py", line 1082, in _read
    raise MissingSectionHeaderError(fpname, lineno, line)
configparser.MissingSectionHeaderError: File contains no section headers.
file: 'config.txt', line: 1
'\ufeff[credentials]\n

This error will happen if config.txt file encoding is not UTF-8, maybe will happen if the encoding is UTF-8 BOM.
So, all you have to do is to change the encoding of the file to UTF-8.

Hint: you can change the encoding with Notepad++, Sublime Text, or any other text editor allows you that.

@m-primo m-primo closed this as completed Jun 6, 2021
Repository owner locked and limited conversation to collaborators Jun 6, 2021
@m-primo m-primo pinned this issue Jun 6, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant