Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 494486

Summary: net-misc/flexget-1.1.138 with dev-python/jsonschema-2.3.0 - flexget --check: ERROR manager Task test task: expected string or buffer
Product: Gentoo Linux Reporter: Craig Andrews <candrews>
Component: Current packagesAssignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it <maintainer-needed>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: candrews, chutzpah, floppym
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: http://flexget.com/ticket/2291
https://bugs.gentoo.org/show_bug.cgi?id=601888
Whiteboard:
Package list:
Runtime testing required: ---

Description Craig Andrews gentoo-dev 2013-12-17 03:53:35 UTC
When using net-misc/flexget with dev-python/jsonschema-2.3.0, valid configuration fails at runtime. I have reported this issue upstream in flexget at http://flexget.com/ticket/2291 Here's the problem:

In config.yml, try a block like this:

tasks:
  test task:
    rss:
      url: http://rss.thepiratebay.sx/0
      link:
        - magneturi
        - link

Then run flexget --check

The result is:

2013-11-19 15:40 ERROR    manager                       Task test task: expected string or buffer
Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/flexget/manager.py", line 641, in execute
    task.execute(disable_phases=disable_phases, entries=entries)
  File "/usr/lib64/python2.7/site-packages/flexget/task.py", line 45, in wrapper
    return func(self, *args, **kw)
  File "/usr/lib64/python2.7/site-packages/flexget/task.py", line 441, in execute
    errors = self.validate()
  File "/usr/lib64/python2.7/site-packages/flexget/task.py", line 529, in validate
    errors = self.validate_config(self.config)
  File "/usr/lib64/python2.7/site-packages/flexget/task.py", line 545, in validate_config
    return config_schema.process_config(config, schema)
  File "/usr/lib64/python2.7/site-packages/flexget/config_schema.py", line 65, in process_config
    errors = list(validator.iter_errors(config))
  File "/usr/lib64/python2.7/site-packages/jsonschema/validators.py", line 95, in iter_errors
    for error in errors:
  File "/usr/lib64/python2.7/site-packages/flexget/config_schema.py", line 221, in validate_properties_w_defaults
    for error in jsonschema.Draft4Validator.VALIDATORS["properties"](validator, properties, instance, schema):
  File "/usr/lib64/python2.7/site-packages/jsonschema/_validators.py", line 285, in properties_draft4
    schema_path=property,
  File "/usr/lib64/python2.7/site-packages/jsonschema/validators.py", line 108, in descend
    for error in self.iter_errors(instance, schema):
  File "/usr/lib64/python2.7/site-packages/jsonschema/validators.py", line 95, in iter_errors
    for error in errors:
  File "/usr/lib64/python2.7/site-packages/jsonschema/_validators.py", line 199, in ref
    for error in validator.descend(instance, resolved):
  File "/usr/lib64/python2.7/site-packages/jsonschema/validators.py", line 108, in descend
    for error in self.iter_errors(instance, schema):
  File "/usr/lib64/python2.7/site-packages/jsonschema/validators.py", line 95, in iter_errors
    for error in errors:
  File "/usr/lib64/python2.7/site-packages/flexget/config_schema.py", line 227, in validate_anyOf
    for e in select_child_errors(validator, errors):
  File "/usr/lib64/python2.7/site-packages/flexget/config_schema.py", line 178, in select_child_errors
    for error in errors:
  File "/usr/lib64/python2.7/site-packages/jsonschema/_validators.py", line 345, in anyOf_draft4
    errs = list(validator.descend(instance, subschema, schema_path=index))
  File "/usr/lib64/python2.7/site-packages/jsonschema/validators.py", line 108, in descend
    for error in self.iter_errors(instance, schema):
  File "/usr/lib64/python2.7/site-packages/jsonschema/validators.py", line 95, in iter_errors
    for error in errors:
  File "/usr/lib64/python2.7/site-packages/jsonschema/_validators.py", line 155, in format
    validator.format_checker.check(instance, format)
  File "/usr/lib64/python2.7/site-packages/jsonschema/_format.py", line 74, in check
    result = func(instance)
  File "/usr/lib64/python2.7/site-packages/flexget/config_schema.py", line 117, in is_url
    return re.match(regexp, instance)
  File "/usr/lib64/python2.7/re.py", line 137, in match
    return _compile(pattern, flags).match(string)

According to http://flexget.com/wiki/Plugins/rss that should work, and it does work with dev-python/jsonschema-2.0.0.

I believe that the ebuild for net-misc/flexget should have the dependency on dev-python/jsonschema changed from:
>=dev-python/jsonschema-2.0[${PYTHON_USEDEP}]
to:
=dev-python/jsonschema-2.0[${PYTHON_USEDEP}]

in order to reflect the fact that flexget doesn't work with newer versions of jsonschema, and then when a fixed version of flexget is released the dependency expression can be changed back.

Reproducible: Always
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2016-12-10 08:46:18 UTC
This one looks like a bug in jsonschema as well.
Comment 2 Pacho Ramos gentoo-dev 2017-01-10 15:41:42 UTC
try with jsonschema-2.5.1-r2 please