Skip to content

"invalid literal for int() with base 10" on Python 2.7.12 #5

@matkoniecz

Description

@matkoniecz

I tried

from html_validator import validate

errors = validate("index.html")
for err in errors:
    print("Type: %s, File: %s, Line: %d, Description: %s" % (err.type, err.file, err.line, err.description)) 

on

<html>
<head>
</head>
<body></body>
</html>

and it falied with

Traceback (most recent call last):
  File "validator.python2.py", line 5, in <module>
    errors = validate("index.html")
  File "/usr/local/lib/python2.7/dist-packages/html_validator/html_validator.py", line 160, in validate
    ret.append(ValidationError(i))
  File "/usr/local/lib/python2.7/dist-packages/html_validator/html_validator.py", line 62, in __init__
    self.line = int(err_wo_filename.split('.')[0].strip())
ValueError: invalid literal for int() with base 10: ''

I tried it also on a bigger html file and it failed with the same error.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions