Open ssrsec opened 9 months ago
If relying on other libraries, I hope to be compatible with the latest version
That must be a library required by requests or even urllib3.
If you don't need socks proxy or http/0.9 support you can install requests-raw==1.0.1
If you do need, maybe I will create new branch and update 1.0.1 to 1.1.0, it will not be up to date with latest requests updates because it will be hard coded to version 2.29.0 the last version before the urllib3 2.0 update
Due to the needs of other modules, my requests library version is usually kept at the latest version, and I need to use a version of requests raw that supports socks5
Traceback (most recent call last):
File "/Users/ssr/xxx/code/python/4.py", line 3, in
Traceback (most recent call last):
File "/Users/ssr/xxx/code/python/4.py", line 3, in
import requests_raw
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_raw/init.py", line 3, in
from .api import request, raw
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_raw/api.py", line 1, in
from .sessions import Session
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_raw/sessions.py", line 2, in
from .adapters import RawAdapter
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_raw/adapters.py", line 5, in
from .connectionpool import RawHTTPConnectionPool, RawHTTPSConnectionPool
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_raw/connectionpool.py", line 1, in
from .connection import RawHTTPConnection, RawHTTPSConnection
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_raw/connection.py", line 8, in
from urllib3.connection import HTTPConnection, HTTPSConnection, _TYPE_BODY
ImportError: cannot import name '_TYPE_BODY' from 'urllib3.connection' (/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connection.py)
Can you add a code snippet that reproduce the issue? Maybe I can find a workaround for you, Please also add requirements.txt and check that the error reproduced on virtual environment 😅 Also add the versions of the libraries like you did in previous messages
@ssrsec can you change the order of requirements from: pip install certipy-ad==4.8.2 requests-raw==2.0.2 to: pip install requests-raw==2.0.2 certipy-ad==4.8.2 it should fix your issue the order matters, that way you will get the latest version of requests-raw with the latest version of certipy-ad
about-time==4.2.1
accelerate==0.28.0
aiodns==3.1.1
aiohttp==3.9.5
aiohttp-socks==0.8.4
aioredis==2.0.1
aiosignal==1.3.1
alive-progress==3.1.5
aliyun-python-sdk-core==2.14.0
aliyun-python-sdk-kms==2.16.2
androguard==3.3.5
anyio==4.1.0
appscript==1.2.2
arabic-reshaper==3.0.0
asgiref==3.6.0
asn1crypto==1.5.1
astroid==2.15.0
asttokens==2.4.1
async-timeout==4.0.2
attrs==23.1.0
Authlib==1.2.1
Automat==22.10.0
autopep8==1.6.0
bcrypt==4.0.1
beautifulsoup4==4.12.2
bitstring==4.0.2
boltons==21.0.0
bracex==2.4
Brotli==1.1.0
cchardet==2.1.7
certifi==2021.10.8
certipy-ad==4.8.2
cffi==1.16.0
chardet==5.2.0
charset-normalizer==2.0.8
click==8.1.3
click-option-group==0.5.6
colorama==0.4.4
coloredlogs==15.0.1
colorlog==6.7.0
constantly==23.10.4
contourpy==1.2.0
crcmod==1.7
cryptography==40.0.2
cssselect2==0.7.0
cx-Oracle==8.3.0
cycler==0.12.1
datasets==2.18.0
datasketch==1.6.4
ddddocr==1.4.11
decorator==5.1.1
defusedxml==0.7.1
dill==0.3.8
Django==4.2
django-cors-headers==3.14.0
dnspython==2.3.0
docker==6.1.3
docopt==0.6.2
docstring-to-markdown==0.11
docx2pdf==0.1.8
docx2txt==0.8
dpkt==1.9.8
ds-store==1.3.1
dsinternals==1.2.4
et-xmlfile==1.1.0
exceptiongroup==1.2.0
executing==2.0.1
face==22.0.0
filelock==3.13.1
flake8==6.0.0
Flask==2.2.3
flatbuffers==24.3.25
fonttools==4.46.0
frozenlist==1.3.3
fsspec==2024.2.0
ftfy==6.1.1
func-timeout==4.3.5
future==0.18.3
fuzzywuzzy==0.18.0
geoip2==4.7.0
gevent==24.2.1
glom==22.1.0
grapheme==0.6.0
graphviz==0.19
greenlet==3.0.3
gvcode==1.0.3
h11==0.14.0
html5lib==1.1
httpcore==1.0.2
httpx==0.25.2
huggingface-hub==0.21.4
humanfriendly==10.0
hyperlink==21.0.0
idna==3.3
imageio==2.34.0
impacket==0.11.0
importlib-metadata==6.5.0
importlib-resources==6.1.1
incremental==22.10.0
install==1.3.5
IPy==1.1
ipython==8.18.1
isort==5.12.0
itsdangerous==2.1.2
jedi==0.18.2
Jinja2==3.1.2
jmespath==0.10.0
joblib==1.3.2
jsonschema==4.20.0
jsonschema-specifications==2023.11.1
kiwisolver==1.4.5
lazy-object-proxy==1.9.0
lazy_loader==0.3
ldap3==2.9.1
ldapdomaindump==0.9.4
lime==0.2.0.1
loguru==0.7.2
lxml==4.9.2
mac-alias==2.2.2
markdown-it-py==3.0.0
MarkupSafe==2.1.2
matplotlib==3.8.2
matplotlib-inline==0.1.6
maxminddb==2.4.0
mccabe==0.7.0
mdurl==0.1.2
mmh3==3.1.0
mpmath==1.3.0
multidict==6.0.4
multiprocess==0.70.16
Naked==0.1.32
netaddr==0.8.0
netifaces==0.11.0
networkx==3.2.1
nfstream==6.5.3
node-vm2==0.4.5
ntplib==0.4.0
numpy==1.26.4
onnxruntime==1.17.1
OpenCC==0.2
opencv-python==4.9.0.80
opencv-python-headless==4.9.0.80
openpyxl==3.1.2
oscrypto==1.3.0
oss2==2.18.4
packaging==23.0
pandas==2.2.2
paramiko==3.2.0
parso==0.8.3
pathlib==1.0.1
peewee==3.17.0
pexpect==4.9.0
pg8000==1.29.5
pi==0.1.2
Pillow==9.5.0
pipreqs==0.4.13
platformdirs==3.1.1
playwright==1.42.0
pluggy==1.0.0
prettytable==3.7.0
prompt-toolkit==3.0.41
protobuf==5.26.1
psutil==5.9.8
ptyprocess==0.7.0
pure-eval==0.2.2
py-cpuinfo==9.0.0
pyahocorasick==2.0.0
pyarmor==8.3.10
pyarmor.cli.core==4.3.6
pyarrow==15.0.1
pyarrow-hotfix==0.6
pyasn1==0.4.8
pyasn1-modules==0.3.0
pycares==4.4.0
pycodestyle==2.10.0
pycparser==2.22
pycryptodome==3.17
pycryptodomex==3.17
pyDes==2.0.1
pydocstyle==6.2.3
pydot==1.4.2
pyee==11.0.1
pyfiglet==0.8.post1
pyflakes==3.0.1
Pygments==2.16.1
pyHanko==0.23.1
pyhanko-certvalidator==0.26.3
PyJWT==2.7.0
pylint==2.17.0
pymemcache==4.0.0
pyminizip==0.2.6
pymongo==4.3.3
PyMySQL==1.0.3
PyNaCl==1.5.0
pyodbc==4.0.39
pyOpenSSL==23.1.1
pyparsing==3.0.9
pypdf==4.1.0
pypinyin==0.48.0
pypng==0.20220715.0
pypsrp==0.8.1
PyQt5==5.15.10
PyQt5-Qt5==5.15.12
PyQt5-sip==12.13.0
pysmb==1.2.9.1
PySocks==1.7.1
pyspnego==0.8.0
python-bidi==0.4.2
python-dateutil==2.8.2
python-docx==0.8.11
python-ldap==3.4.3
python-lsp-jsonrpc==1.0.0
python-lsp-server==1.7.1
python-nmap==0.7.1
python-socks==2.4.3
pytoolconfig==1.2.5
pytz==2024.1
PyYAML==6.0
qqwry-py3==1.2.1
qrcode==7.4.2
rdp==0.8
redis==4.5.5
referencing==0.31.0
regex==2023.12.25
reportlab==4.0.9
requests==2.31.0
requests-ntlm==1.2.0
requests-raw==2.0.2
rich==13.5.2
rope==1.7.0
rpds-py==0.13.1
ruamel.yaml==0.17.40
ruamel.yaml.clib==0.2.8
safetensors==0.4.2
scapy==2.5.0
scikit-image==0.22.0
scikit-learn==1.4.1.post1
scipy==1.11.3
scramp==1.4.4
seaborn==0.13.2
semgrep==1.50.0
shellescape==3.8.1
signxml==3.2.0
simhash==2.1.2
simplejson==3.19.1
six==1.16.0
sniffio==1.3.0
snowballstemmer==2.2.0
socks==0
soupsieve==2.4.1
spark-parser==1.8.9
sqlparse==0.4.3
stack-data==0.6.3
svglib==1.5.1
sympy==1.12
termcolor==2.2.0
thop==0.1.1.post2209072238
threadpool==1.3.2
threadpoolctl==3.3.0
tifffile==2024.2.12
tinycss2==1.2.1
tld==0.13
tokenizers==0.15.2
toml==0.10.2
tomli==2.0.1
tomlkit==0.11.6
torch==2.3.0
torchvision==0.18.0
tornado==6.3.1
tqdm==4.65.0
traitlets==5.14.0
transformers==4.38.2
Twisted==23.10.0
typing_extensions==4.10.0
tzdata==2024.1
tzlocal==5.2
ujson==5.7.0
ultralytics==8.2.4
uncompyle==2.0.0
uncompyle6==3.9.0
unicrypto==0.0.10
uritools==4.0.2
urllib3==1.26.18
uWSGI==2.0.26
wcmatch==8.5
wcwidth==0.2.6
webencodings==0.5.1
websocket-client==1.6.1
websockets==11.0.3
Werkzeug==2.2.3
whatthepatch==1.0.4
wrapt==1.15.0
wshandler==66.0.2
xdis==6.0.5
xhtml2pdf==0.2.15
xxhash==3.4.1
yapf==0.32.0
yarg==0.1.9
yarl==1.8.2
zipp==3.15.0
zope.event==5.0
zope.interface==6.1
Traceback (most recent call last):
File "/Users/ssr/test/code/python/test/a.py", line 3, in
Thank you for the information, It looks like a bug. I will investigate it
On Fri, 14 Jun 2024 at 19:00 说书人 @.***> wrote:
about-time==4.2.1 accelerate==0.28.0 aiodns==3.1.1 aiohttp==3.9.5 aiohttp-socks==0.8.4 aioredis==2.0.1 aiosignal==1.3.1 alive-progress==3.1.5 aliyun-python-sdk-core==2.14.0 aliyun-python-sdk-kms==2.16.2 androguard==3.3.5 anyio==4.1.0 appscript==1.2.2 arabic-reshaper==3.0.0 asgiref==3.6.0 asn1crypto==1.5.1 astroid==2.15.0 asttokens==2.4.1 async-timeout==4.0.2 attrs==23.1.0 Authlib==1.2.1 Automat==22.10.0 autopep8==1.6.0 bcrypt==4.0.1 beautifulsoup4==4.12.2 bitstring==4.0.2 boltons==21.0.0 bracex==2.4 Brotli==1.1.0 cchardet==2.1.7 certifi==2021.10.8 certipy-ad==4.8.2 cffi==1.16.0 chardet==5.2.0 charset-normalizer==2.0.8 click==8.1.3 click-option-group==0.5.6 colorama==0.4.4 coloredlogs==15.0.1 colorlog==6.7.0 constantly==23.10.4 contourpy==1.2.0 crcmod==1.7 cryptography==40.0.2 cssselect2==0.7.0 cx-Oracle==8.3.0 cycler==0.12.1 datasets==2.18.0 datasketch==1.6.4 ddddocr==1.4.11 decorator==5.1.1 defusedxml==0.7.1 dill==0.3.8 Django==4.2 django-cors-headers==3.14.0 dnspython==2.3.0 docker==6.1.3 docopt==0.6.2 docstring-to-markdown==0.11 docx2pdf==0.1.8 docx2txt==0.8 dpkt==1.9.8 ds-store==1.3.1 dsinternals==1.2.4 et-xmlfile==1.1.0 exceptiongroup==1.2.0 executing==2.0.1 face==22.0.0 filelock==3.13.1 flake8==6.0.0 Flask==2.2.3 flatbuffers==24.3.25 fonttools==4.46.0 frozenlist==1.3.3 fsspec==2024.2.0 ftfy==6.1.1 func-timeout==4.3.5 future==0.18.3 fuzzywuzzy==0.18.0 geoip2==4.7.0 gevent==24.2.1 glom==22.1.0 grapheme==0.6.0 graphviz==0.19 greenlet==3.0.3 gvcode==1.0.3 h11==0.14.0 html5lib==1.1 httpcore==1.0.2 httpx==0.25.2 huggingface-hub==0.21.4 humanfriendly==10.0 hyperlink==21.0.0 idna==3.3 imageio==2.34.0 impacket==0.11.0 importlib-metadata==6.5.0 importlib-resources==6.1.1 incremental==22.10.0 install==1.3.5 IPy==1.1 ipython==8.18.1 isort==5.12.0 itsdangerous==2.1.2 jedi==0.18.2 Jinja2==3.1.2 jmespath==0.10.0 joblib==1.3.2 jsonschema==4.20.0 jsonschema-specifications==2023.11.1 kiwisolver==1.4.5 lazy-object-proxy==1.9.0 lazy_loader==0.3 ldap3==2.9.1 ldapdomaindump==0.9.4 lime==0.2.0.1 loguru==0.7.2 lxml==4.9.2 mac-alias==2.2.2 markdown-it-py==3.0.0 MarkupSafe==2.1.2 matplotlib==3.8.2 matplotlib-inline==0.1.6 maxminddb==2.4.0 mccabe==0.7.0 mdurl==0.1.2 mmh3==3.1.0 mpmath==1.3.0 multidict==6.0.4 multiprocess==0.70.16 Naked==0.1.32 netaddr==0.8.0 netifaces==0.11.0 networkx==3.2.1 nfstream==6.5.3 node-vm2==0.4.5 ntplib==0.4.0 numpy==1.26.4 onnxruntime==1.17.1 OpenCC==0.2 opencv-python==4.9.0.80 opencv-python-headless==4.9.0.80 openpyxl==3.1.2 oscrypto==1.3.0 oss2==2.18.4 packaging==23.0 pandas==2.2.2 paramiko==3.2.0 parso==0.8.3 pathlib==1.0.1 peewee==3.17.0 pexpect==4.9.0 pg8000==1.29.5 pi==0.1.2 Pillow==9.5.0 pipreqs==0.4.13 platformdirs==3.1.1 playwright==1.42.0 pluggy==1.0.0 prettytable==3.7.0 prompt-toolkit==3.0.41 protobuf==5.26.1 psutil==5.9.8 ptyprocess==0.7.0 pure-eval==0.2.2 py-cpuinfo==9.0.0 pyahocorasick==2.0.0 pyarmor==8.3.10 pyarmor.cli.core==4.3.6 pyarrow==15.0.1 pyarrow-hotfix==0.6 pyasn1==0.4.8 pyasn1-modules==0.3.0 pycares==4.4.0 pycodestyle==2.10.0 pycparser==2.22 pycryptodome==3.17 pycryptodomex==3.17 pyDes==2.0.1 pydocstyle==6.2.3 pydot==1.4.2 pyee==11.0.1 pyfiglet==0.8.post1 pyflakes==3.0.1 Pygments==2.16.1 pyHanko==0.23.1 pyhanko-certvalidator==0.26.3 PyJWT==2.7.0 pylint==2.17.0 pymemcache==4.0.0 pyminizip==0.2.6 pymongo==4.3.3 PyMySQL==1.0.3 PyNaCl==1.5.0 pyodbc==4.0.39 pyOpenSSL==23.1.1 pyparsing==3.0.9 pypdf==4.1.0 pypinyin==0.48.0 pypng==0.20220715.0 pypsrp==0.8.1 PyQt5==5.15.10 PyQt5-Qt5==5.15.12 PyQt5-sip==12.13.0 pysmb==1.2.9.1 PySocks==1.7.1 pyspnego==0.8.0 python-bidi==0.4.2 python-dateutil==2.8.2 python-docx==0.8.11 python-ldap==3.4.3 python-lsp-jsonrpc==1.0.0 python-lsp-server==1.7.1 python-nmap==0.7.1 python-socks==2.4.3 pytoolconfig==1.2.5 pytz==2024.1 PyYAML==6.0 qqwry-py3==1.2.1 qrcode==7.4.2 rdp==0.8 redis==4.5.5 referencing==0.31.0 regex==2023.12.25 reportlab==4.0.9 requests==2.31.0 requests-ntlm==1.2.0 requests-raw==2.0.2 rich==13.5.2 rope==1.7.0 rpds-py==0.13.1 ruamel.yaml==0.17.40 ruamel.yaml.clib==0.2.8 safetensors==0.4.2 scapy==2.5.0 scikit-image==0.22.0 scikit-learn==1.4.1.post1 scipy==1.11.3 scramp==1.4.4 seaborn==0.13.2 semgrep==1.50.0 shellescape==3.8.1 signxml==3.2.0 simhash==2.1.2 simplejson==3.19.1 six==1.16.0 sniffio==1.3.0 snowballstemmer==2.2.0 socks==0 soupsieve==2.4.1 spark-parser==1.8.9 sqlparse==0.4.3 stack-data==0.6.3 svglib==1.5.1 sympy==1.12 termcolor==2.2.0 thop==0.1.1.post2209072238 threadpool==1.3.2 threadpoolctl==3.3.0 tifffile==2024.2.12 tinycss2==1.2.1 tld==0.13 tokenizers==0.15.2 toml==0.10.2 tomli==2.0.1 tomlkit==0.11.6 torch==2.3.0 torchvision==0.18.0 tornado==6.3.1 tqdm==4.65.0 traitlets==5.14.0 transformers==4.38.2 Twisted==23.10.0 typing_extensions==4.10.0 tzdata==2024.1 tzlocal==5.2 ujson==5.7.0 ultralytics==8.2.4 uncompyle==2.0.0 uncompyle6==3.9.0 unicrypto==0.0.10 uritools==4.0.2 urllib3==1.26.18 uWSGI==2.0.26 wcmatch==8.5 wcwidth==0.2.6 webencodings==0.5.1 websocket-client==1.6.1 websockets==11.0.3 Werkzeug==2.2.3 whatthepatch==1.0.4 wrapt==1.15.0 wshandler==66.0.2 xdis==6.0.5 xhtml2pdf==0.2.15 xxhash==3.4.1 yapf==0.32.0 yarg==0.1.9 yarl==1.8.2 zipp==3.15.0 zope.event==5.0 zope.interface==6.1
Traceback (most recent call last): File "/Users/ssr/说书人/code/python/测试区/a.py", line 3, in import requests_raw File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_raw/ init.py", line 3, in from .api import request, raw File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_raw/api.py", line 1, in from .sessions import Session File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_raw/sessions.py", line 2, in from .adapters import RawAdapter File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_raw/adapters.py", line 5, in from .connectionpool import RawHTTPConnectionPool, RawHTTPSConnectionPool File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_raw/connectionpool.py", line 1, in from .connection import RawHTTPConnection, RawHTTPSConnection File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/requests_raw/connection.py", line 8, in from urllib3.connection import HTTPConnection, HTTPSConnection, _TYPE_BODY ImportError: cannot import name '_TYPE_BODY' from 'urllib3.connection' (/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/urllib3/connection.py)
— Reply to this email directly, view it on GitHub https://github.com/realgam3/requests-raw/issues/9#issuecomment-2168324635, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABKOSGBKCUHIZBGM22KHCNLZHMHRDAVCNFSM6AAAAABCAMBRA6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRYGMZDINRTGU . You are receiving this because you commented.Message ID: @.***>
After a lot of testing I found out the issue is "urllib3==1.26.18" if you upgrade this library requests-raw will work flawlessly...
I'm thinking about making a version of requests-raw that will work with any urllib3 version, maybe even work on py 2.7...
for now,
I have created a branch for you and I will explain how to install it until (if) I will make it official :)
pip install git+https://github.com/realgam3/requests-raw.git@v2.0.3
for requirements:
requests-raw @ git+https://github.com/realgam3/requests-raw.git@v2.0.3
waiting to hear if it works for you... :)
I am currently unable to test because my project must rely on "urllib3=1.26.18", at least in the short term, as higher versions of urllib will render my "PrepareRequest" writing ineffective. In the future, I plan to replace all the code related to "PrepareRequest" writing in the old version with requests raw implementation, which is a large project. Therefore, I am looking forward to requests raw adapting to the latest version of urllib3. Once you successfully test it, I will try to upgrade urllib3 to the latest version and use "pip3 install requests raw - U" to implement it. To complete the update. thank you.
I am currently unable to test because my project must rely on "urllib3=1.26.18", at least in the short term, as higher versions of urllib will render my "PrepareRequest" writing ineffective. In the future, I plan to replace all the code related to "PrepareRequest" writing in the old version with requests raw implementation, which is a large project. Therefore, I am looking forward to requests raw adapting to the latest version of urllib3. Once you successfully test it, I will try to upgrade urllib3 to the latest version and use "pip3 install requests raw - U" to implement it. To complete the update. thank you.
You are probably right, in the past you had hooks for pre_request, post_request and same for response, now you have only for response...
I will make this update official, just need you to test it for me that it works for you :)
certipy-ad 4.8.2 requires pyasn1==0.4.8, but you have pyasn1 0.5.1 which is incompatible.