-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Is it possible to validate locally saved files?
I tried:
from w3c_validator import validate
file = '/path/to/file.xhtml'
with open(file, encoding='utf8') as infile:
# print(infile.readlines()[:10]) # check that the file is properly opened
messages = validate(infile)["messages"]
for m in messages:
print("Type: %(type)s, Line: %(lastLine)d, Description: %(message)s" % m)
Traceback (most recent call last):
File "<stdin>", line 3, in <module>
File "/Users/username/miniconda3/envs/vs/lib/python3.8/site-packages/w3c_validator/validator.py", line 41, in validate
is_remote = filename.startswith("http://") or filename.startswith(
AttributeError: '_io.TextIOWrapper' object has no attribute 'startswith'
Metadata
Metadata
Assignees
Labels
No labels