gpakosz / .tmux

🇫🇷 Oh my tmux! My self-contained, pretty & versatile tmux configuration made with ❤️
MIT License
21.79k stars 3.36k forks source link

urllib.request.urlopen() error [Errno 111] #611

Closed Albert-Zhao-2020 closed 1 year ago

Albert-Zhao-2020 commented 1 year ago

if I run "urllib.request.urlopen() " commond in the tmux environment, it will cause an error of "urllib.request.urlopen() error [Errno 111]". But if do not run it in the tmux environment , it is OK. So, any one would soolve it? I will appreciate it. the python code as below, it is so easy and simulate the process of logining the web.

from urllib import request

def test_web(): url = 'https://www.baidu.com/' headers ={

the code line below can also be deledted

    "User-Agent": 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/106.0.0.0 Safari/537.36'
}

req = request.Request(url, headers=headers)
res = request.urlopen(req)
print('Status:', res.status, res.reason)

test_web()

gpakosz commented 1 year ago

Hello @Albert-Zhao-2020 👋

I doubt a Python script not working has anything to do with tmux or Oh my tmux! Please try with a stock configuration by running

$ tmux -f /dev/null -L test