import urllib.request
import io

u = urllib.request.urlopen('http://www.python.org')
print(u)


f = io.TextIOWrapper(u, encoding='utf-8')
text = f.read()
# print(text)

import sys


sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding='latin-1')

print(sys.stdout.encoding)

2d27642a1ce1fce0d1c2417eccccd19dbefe49d9
<mask token>

<mask token>
print(u)
<mask token>
print(sys.stdout.encoding)

<mask token>
u = urllib.request.urlopen('http://www.python.org')
print(u)
f = io.TextIOWrapper(u, encoding='utf-8')
text = f.read()
<mask token>
sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding='latin-1')
print(sys.stdout.encoding)

import urllib.request
import io
u = urllib.request.urlopen('http://www.python.org')
print(u)
f = io.TextIOWrapper(u, encoding='utf-8')
text = f.read()
import sys
sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding='latin-1')
print(sys.stdout.encoding)

import urllib.request
import io

u = urllib.request.urlopen('http://www.python.org')
print(u)


f = io.TextIOWrapper(u, encoding='utf-8')
text = f.read()
# print(text)

import sys


sys.stdout = io.TextIOWrapper(sys.stdout.detach(), encoding='latin-1')

print(sys.stdout.encoding)
