Skip to content

New TestDict.test_hypothesis failure in test_configtypes.py #8530

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

Open
The-Compiler opened this issue Apr 4, 2025 · 0 comments
Open

New TestDict.test_hypothesis failure in test_configtypes.py #8530

The-Compiler opened this issue Apr 4, 2025 · 0 comments
Labels
bug: exception A Python exception gets thrown. component: config Issues related to configuration. priority: 1 - middle Issues which should be done at some point, but aren't that important.

Comments

@The-Compiler
Copy link
Member

Got this locally:

__________________________________________________________________ TestDict.test_hypothesis __________________________________________________________________

self = <qutebrowser.config.configtypes.Dict fixed_keys=None keytype=<qutebrowser.config.configtypes.String completions=None e...ues=None> none_ok=True required_keys=None valtype=<qutebrowser.config.configtypes.Bool completions=None none_ok=False>>
value = '{"\\u1e70\\u033a\\u033a\\u0315o\\u035e \\u0337i\\u0332\\u032c\\u0347\\u032a\\u0359n\\u031d\\u0317\\u0355v\\u031f\\u03...\\u032c\\u031fh\\u0361a\\u032b\\u033b\\u032f\\u0358o\\u032b\\u031f\\u0316\\u034d\\u0319\\u031d\\u0349s\\u0317": false}'

    def from_str(self, value: str) -> Optional[dict]:
        self._basic_str_validation(value)
        if not value:
            return None
    
        try:
>           yaml_val = utils.yaml_load(value)

qutebrowser/config/configtypes.py:1405: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
qutebrowser/utils/utils.py:660: in yaml_load
    data = yaml.load(f, Loader=YamlLoader)
.venv-qt69/lib/python3.13/site-packages/yaml/__init__.py:81: in load
    return loader.get_single_data()
.venv-qt69/lib/python3.13/site-packages/yaml/constructor.py:49: in get_single_data
    node = self.get_single_node()
yaml/_yaml.pyx:673: in yaml._yaml.CParser.get_single_node
    ???
yaml/_yaml.pyx:687: in yaml._yaml.CParser._compose_document
    ???
yaml/_yaml.pyx:731: in yaml._yaml.CParser._compose_node
    ???
yaml/_yaml.pyx:847: in yaml._yaml.CParser._compose_mapping_node
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

>   ???
E   yaml.parser.ParserError: while parsing a flow mapping
E     in "<unicode string>", line 1, column 1
E   did not find expected ',' or '}'
E     in "<unicode string>", line 1, column 1027

yaml/_yaml.pyx:860: ParserError

During handling of the above exception, another exception occurred:

self = <test_configtypes.TestDict object at 0x74863800ac60>, klass = <class 'qutebrowser.config.configtypes.Dict'>

    @hypothesis.given(val=strategies.dictionaries(
>       strategies.text(min_size=1, alphabet=strategies.characters(
            # No control characters, surrogates, or codepoints encoded as
            # surrogate
            blacklist_categories=['Cc', 'Cs'], max_codepoint=0xFFFF)),
        strategies.booleans()))

tests/unit/config/test_configtypes.py:1621: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
tests/unit/config/test_configtypes.py:1632: in test_hypothesis
    assert d.from_str(d.to_str(converted)) == expected
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <qutebrowser.config.configtypes.Dict fixed_keys=None keytype=<qutebrowser.config.configtypes.String completions=None e...ues=None> none_ok=True required_keys=None valtype=<qutebrowser.config.configtypes.Bool completions=None none_ok=False>>
value = '{"\\u1e70\\u033a\\u033a\\u0315o\\u035e \\u0337i\\u0332\\u032c\\u0347\\u032a\\u0359n\\u031d\\u0317\\u0355v\\u031f\\u03...\\u032c\\u031fh\\u0361a\\u032b\\u033b\\u032f\\u0358o\\u032b\\u031f\\u0316\\u034d\\u0319\\u031d\\u0349s\\u0317": false}'

    def from_str(self, value: str) -> Optional[dict]:
        self._basic_str_validation(value)
        if not value:
            return None
    
        try:
            yaml_val = utils.yaml_load(value)
        except yaml.YAMLError as e:
>           raise configexc.ValidationError(value, str(e))
E           qutebrowser.config.configexc.ValidationError: Invalid value '{"\u1e70\u033a\u033a\u0315o\u035e \u0337i\u0332\u032c\u0347\u032a\u0359n\u031d\u0317\u0355v\u031f\u031c\u0318\u0326\u035fo\u0336\u0319\u0330\u0320k\u00e8\u035a\u032e\u033a\u032a\u0339\u0331\u0324 \u0316t\u031d\u0355\u0333\u0323\u033b\u032a\u035eh\u033c\u0353\u0332\u0326\u0333\u0318\u0332e\u0347\u0323\u0330\u0326\u032c\u034e \u0322\u033c\u033b\u0331\u0318h\u035a\u034e\u0359\u031c\u0323\u0332\u0345i\u0326\u0332\u0323\u0330\u0324v\u033b\u034de\u033a\u032d\u0333\u032a\u0330-m\u0322i\u0345n\u0316\u033a\u031e\u0332\u032f\u0330d\u0335\u033c\u031f\u0359\u0329\u033c\u0318\u0333 \u031e\u0325\u0331\u0333\u032dr\u031b\u0317\u0318e\u0359p\u0360r\u033c\u031e\u033b\u032d\u0317e\u033a\u0320\u0323\u035fs\u0318\u0347\u0333\u034d\u031d\u0349e\u0349\u0325\u032f\u031e\u0332\u035a\u032c\u035c\u01f9\u032c\u034e\u034e\u031f\u0316\u0347\u0324t\u034d\u032c\u0324\u0353\u033c\u032d\u0358\u0345i\u032a\u0331n\u0360g\u0334\u0349 \u034f\u0349\u0345c\u032c\u031fh\u0361a\u032b\u033b\u032f\u0358o\u032b\u031f\u0316\u034d\u0319\u031d\u0349s\u0317": false}' - while parsing a flow mapping
E             in "<unicode string>", line 1, column 1
E           did not find expected ',' or '}'
E             in "<unicode string>", line 1, column 1027
E           Falsifying example: test_hypothesis(
E               self=<test_configtypes.TestDict object at 0x74863800ac60>,
E               klass=qutebrowser.config.configtypes.Dict,
E               val={'Ṱ̺̺̕o͞ ̷in̝̗͕vokè ̖the hiv̻͍e-m̢iͅnd r̛̗̘e͙p͠reseǹti̪̱n͠g̴͉ ͏͉ͅc̬̟h͡aos̗': False},
E           )
E           Explanation:
E               These lines were always and only run by failing examples:
E                   /home/florian/proj/qutebrowser/git/.venv-qt69/lib/python3.13/site-packages/yaml/error.py:52
E                   /home/florian/proj/qutebrowser/git/.venv-qt69/lib/python3.13/site-packages/yaml/resolver.py:146

qutebrowser/config/configtypes.py:1407: ValidationError
@The-Compiler The-Compiler added component: config Issues related to configuration. priority: 1 - middle Issues which should be done at some point, but aren't that important. bug: exception A Python exception gets thrown. labels Apr 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: exception A Python exception gets thrown. component: config Issues related to configuration. priority: 1 - middle Issues which should be done at some point, but aren't that important.
Projects
None yet
Development

No branches or pull requests

1 participant