FlorianREGAZ / Python-Tls-Client

Advanced HTTP Library
MIT License
660 stars 136 forks source link

tls_client will be stuck in multiprocessing #101

Open yejunxi opened 9 months ago

yejunxi commented 9 months ago

python 3.10.8 tls-client 0.2.2 centos7

Hello, I have encountered this issue while using it,tls_client will be stuck in multiprocessing, demo:

import multiprocessing
import tls_client

def start():
    url = 'http://www.baidu.com'
    r = tls_client.Session(
        client_identifier="chrome110",
        random_tls_extension_order=True
    ).get(url, timeout_seconds=6)

    # Will not execute here and no exceptions thrown
    print(r.status_code)

if __name__ == '__main__':
   multiprocessing.Process(
       target=start,
       args=()
   ).start()

   while True:
       pass

But I can run normally under Mac