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 in configparser #2

Open
jorritolthuis opened this issue Mar 23, 2018 · 1 comment
Open

Error in configparser #2

jorritolthuis opened this issue Mar 23, 2018 · 1 comment
Assignees
Labels
bug Something isn't working wontfix This will not be worked on

Comments

@jorritolthuis
Copy link
Collaborator

jorritolthuis commented Mar 23, 2018

When setting a new value for a variable in commit 04fc0fe, an error is raised.

  File "/Users/jorrit/Documents/GitHub/AdBleed/src/configuration.py", line 55, in setNumberOfHosts
    self.setConf(self.noOfHosts[0], self.noOfHosts[1], str.encode(value))
  File "/Users/jorrit/Documents/GitHub/AdBleed/src/configuration.py", line 20, in setConf
    self.config.set(section, variable, value)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 1192, in set
    self._validate_value_types(option=option, value=value)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/configparser.py", line 1177, in _validate_value_types
    raise TypeError("option values must be strings")
TypeError: option values must be strings

This error occurs when the user tries to change the value of any variable using the CLI. This version of the CLI is committed in 61e77d0.

@jorritolthuis jorritolthuis added the bug Something isn't working label Mar 23, 2018
@jorritolthuis
Copy link
Collaborator Author

There seems to be a bug in configparser.
If one tries to set the new value of a variable to something of type str (default user input)
2018-04-08 22 30 39
The error shows that one should input a bytes-like object. But when the str is encoded to bytes: bytes(value, 'utf-8'), configparser needs a string object.
2018-04-08 22 30 33

@jorritolthuis jorritolthuis added the wontfix This will not be worked on label Apr 8, 2018
jorritolthuis added a commit that referenced this issue Apr 8, 2018
Temporarily disable the possibility to change settings in the CLI. See #2.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants