Closed NobodyXu closed 4 years ago
I can not reproduce this, maybe you are rate limited at that time? Can you try again?
I tried it again, but it still failed.
No matter I used my wifi or hotspot from my iPhone, it all failed regardless.
Using either my wifi or my hotspot, I can connect to cppreference normally, except that it takes fair amount of time to load the page.
I am suspecting that the crawler set the timeout so low that it considered cppreference as non-accessible while it can be accessed.
I'm using 0.4.9 and also running into this issue. It seems the cppman -c
error is also a bad escape \e at position 0
(though not printed), which comes from line 211 of formatter/cppreference.py
:
data = re.compile(rp[0], rp[2]).sub(rp[1], data)
It's an error that occurred during the application of a RegEx. Maybe it has to do with the Python version (I'm on 3.7)?
Eh, I took a look into formatter/{cplusplus,cppreference}.py
and found two almost identical strings in them. In cplusplus.py
:
# Preserve \n" in EXAMPLE
(r'\\n', r'\\en', 0),
In cppreference.py
a \
is missing from the second raw string:
# Preserve \n" in EXAMPLE
(r'\\n', r'\en', 0),
If I add it back then cppman will work just fine...
Update: I tried Python 2.7, 3.6 and 3.7 with the following:
import re
re.compile(r'\en')
The result is Python 3.x will error (bad escape \e
) while Python 2.7 will not.
Update 2: There is another difference in these files that causes errors:
formatter/cplusplus.py
169: tbl = re.compile(r'T{\n(\..*?)\nT}', re.S).sub(r'T{\n\\E \1\nT}', tbl)
formatter/cppreference.py
40: tbl = re.compile(r'T{\n(\..*?)\nT}', re.S).sub(r'T{\n\E \1\nT}', tbl)
@hexclover thanks for figure out the issue, will send a fix for that.
Edit: this specific issue was actually fixed on master already.
It seems that
cppman
is having problems parsing pages from cppreference, my browser can access cppreference fairly quicklyEdit: