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

AttributeError: 'NoneType' object has no attribute 'startswith' #22

Open
gabays opened this issue Jan 30, 2023 · 2 comments
Open

AttributeError: 'NoneType' object has no attribute 'startswith' #22

gabays opened this issue Jan 30, 2023 · 2 comments

Comments

@gabays
Copy link

gabays commented Jan 30, 2023

Hello!

I see no problem in the log of HTRVX (no red line, no zone or line error) but the test fails and I get this:

Traceback (most recent call last):
  File "/opt/hostedtoolcache/Python/3.8.16/x64/bin/htrvx", line 8, in <module>
    sys.exit(cmd())
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/htrvx/cli.py", line 57, in cmd
    if test(files, verbose=verbose, group=group, format=format, segmonto=segmonto,
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/htrvx/testing.py", line 351, in test
    statuses[file_name] = test_single(
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/htrvx/testing.py", line 307, in test_single
    validator = Validator(Validator.retrieve_xsd(parsed_xml))
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/htrvx/schemas/__init__.py", line 36, in __init__
    xmlschema_doc = etree.parse(self.get_schema(xsd_path), parser=parser)
  File "/opt/hostedtoolcache/Python/3.8.16/x64/lib/python3.8/site-packages/htrvx/schemas/__init__.py", line 60, in get_schema
    if xsd_path.startswith("http://") or xsd_path.startswith("https://"):
AttributeError: 'NoneType' object has no attribute 'startswith'

Cf. this action for this repo. I attach the HTRVX.log

Best,

Simon

@alix-tz
Copy link
Member

alix-tz commented Mar 28, 2023

Hello! I was about to make an issue for this. I fixed it by removing the METS.xml file that is now automatically added to the export.

@PonteIneptique
Copy link
Member

Should be fixed with 0.0.19, please keep me updated, as I only intended the fix to target the XSD issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants