I had cloned the ACL repository and I tried to convert all the markdown files into HTML files using the generate_document.py script which is given in the /tools directory when I ran into this error:
❯ ./generate_document.py
12:45:37 [INFO] start converting, lang=en
12:45:37 [INFO] convert ../document_en/twosat.md
Traceback (most recent call last):
File "/home/tusky/Tushar/ac-library/tools/./generate_document.py", line 89, in
statement = convert(open(md_file).read(), base_dir, opts.tag)
File "/home/tusky/Tushar/ac-library/tools/./generate_document.py", line 50, in convert
if tag == 'production' or re.match(r'v[0-9].[0-9]', tag):
File "/usr/lib/python3.9/re.py", line 191, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like object
After a little bit of googling, I was brought to an answer on Stack Overflow which urged me to wrap the variable tag with the str function which seemed to do the trick.
Thus changing line 50 of generate_document.py to
if tag == 'production' or re.match(r'v[0-9]\.[0-9]', str(tag)):
seems to do the trick and I can now see the desired output:
Thanks a lot @yosupo06 , adding --tag master onto the ./generate_document.py seems to fix the issue, the script now runs as expected without any errors. I think making --tag mandatory as you have in 83c14d0 should do the trick.
rocka0 commentedMar 4, 2021
I had cloned the ACL repository and I tried to convert all the markdown files into HTML files using the generate_document.py script which is given in the /tools directory when I ran into this error:
After a little bit of googling, I was brought to an answer on Stack Overflow which urged me to wrap the variable tag with the
str
function which seemed to do the trick.Thus changing line 50 of generate_document.py to
if tag == 'production' or re.match(r'v[0-9]\.[0-9]', str(tag)):
seems to do the trick and I can now see the desired output:
The text was updated successfully, but these errors were encountered: