Skip to content

xsd2py failing #83

@thomas-mangin

Description

@thomas-mangin

Hello Felix,

I never had to use xsd/wsdl/soap before but I am trying to find a library which can help me implement correctly a tr-069 server (instead of just generating/parsing the XML 'by hand') like many available open source projects.

soapfish seems to be a good contender for the job but before I can even get started I have this issue.
Any help would be welcomed ! Thank you.

# xsd2py https://www.broadband-forum.org/cwmp/cwmp-1-4.xsd
Traceback (most recent call last):
  File "/usr/local/bin/xsd2py", line 9, in <module>
    load_entry_point('soapfish', 'console_scripts', 'xsd2py')()
  File "/Users/thomas/source/tr-69/soapfish/soapfish/xsd2py.py", line 171, in main
    code = generate_code_from_xsd(xmlelement, encoding='utf-8')
  File "/Users/thomas/source/tr-69/soapfish/soapfish/xsd2py.py", line 69, in generate_code_from_xsd
    standalone=True)
  File "/Users/thomas/source/tr-69/soapfish/soapfish/xsd2py.py", line 151, in schema_to_py
    return tpl.render(schema=schema, cwd=cwd, base_path=base_path)
  File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 989, in render
    return self.environment.handle_exception(exc_info, True)
  File "/usr/local/lib/python2.7/site-packages/jinja2/environment.py", line 754, in handle_exception
    reraise(exc_type, exc_value, tb)
  File "/Users/thomas/source/tr-69/soapfish/soapfish/templates/xsd", line 11, in top-level template code
    {{- resolve_import(i, known_files, schema.targetNamespace, cwd, base_path) }}
  File "/Users/thomas/source/tr-69/soapfish/soapfish/xsd2py.py", line 48, in resolve_import
    location = os.path.relpath(location, base_path)
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 430, in relpath
    start_list = [x for x in abspath(start).split(sep) if x]
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 360, in abspath
    if not isabs(path):
  File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/posixpath.py", line 54, in isabs
    return s.startswith('/')
AttributeError: 'NoneType' object has no attribute 'startswith'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions