inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

우리를 위한 프로그래밍 : 파이썬 중급 (Inflearn Original)

asyncio 오류 문의 드립니다.

452

투덜이™

작성한 질문수 3

0

p-chapter07-01.py 실행시 아래와 같이 오류가 발생합니다.

SSL 관련 인증 오류 인 것 같은데 어떻게 해야할 지 모르겠습니다.

지금까지 잘 되었는데, 마지막 Chapter에서 오류가 발생하네요.. ㅠ.ㅠ

 

+ 사용환경 

    + OS : MacOS 12.0.1 (Monterey)

    + Python Ver. : 3.10

+ Error Message 

urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)>

+ Error Log

(p_study) ChangGeuns-MacBook-Pro-15-inch:Python changgeunoh$ /Users/changgeunoh/Desktop/Python/p_study/bin/python /Users/changgeunoh/Desktop/Python/p_study/p_chapter07_01.py

/Users/changgeunoh/Desktop/Python/p_study/p_chapter07_01.py:47: DeprecationWarning: There is no current event loop

  loop = asyncio.get_event_loop()

/Users/changgeunoh/Desktop/Python/p_study/p_chapter07_01.py:23: DeprecationWarning: getName() is deprecated, get the name attribute instead

  print('Thread Name :', threading.current_thread().getName(), 'Start', url)

Thread Name : MainThread Start http://daum.net

Thread Name : MainThread Start https://naver.com

Thread Name : MainThread Start http://mlbpark.donga.com/

Thread Name : MainThread Start https://tistory.com

Thread Name : MainThread Start https://wemakeprice.com/

Traceback (most recent call last):

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open

    h.request(req.get_method(), req.selector, req.data, headers,

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1282, in request

    self._send_request(method, url, body, headers, encode_chunked)

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1328, in _send_request

    self.endheaders(body, encode_chunked=encode_chunked)

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1277, in endheaders

    self._send_output(message_body, encode_chunked=encode_chunked)

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1037, in _send_output

    self.send(msg)

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 975, in send

    self.connect()

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1454, in connect

    self.sock = self._context.wrap_socket(self.sock,

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 512, in wrap_socket

    return self.sslsocket_class._create(

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1070, in _create

    self.do_handshake()

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1341, in do_handshake

    self._sslobj.do_handshake()

ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)

 

During handling of the above exception, another exception occurred:

 

Traceback (most recent call last):

  File "/Users/changgeunoh/Desktop/Python/p_study/p_chapter07_01.py", line 49, in <module>

    loop.run_until_complete(main())

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/asyncio/base_events.py", line 641, in run_until_complete

    return future.result()

  File "/Users/changgeunoh/Desktop/Python/p_study/p_chapter07_01.py", line 40, in main

    rst = await asyncio.gather(*futures)

  File "/Users/changgeunoh/Desktop/Python/p_study/p_chapter07_01.py", line 25, in fetch

    res = await loop.run_in_executor(executor, urlopen, url)

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/thread.py", line 58, in run

    result = self.fn(*self.args, **self.kwargs)

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen

    return opener.open(url, data, timeout)

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open

    response = self._open(req, data)

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open

    result = self._call_chain(self.handle_open, protocol, protocol +

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain

    result = func(*args)

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open

    return self.do_open(http.client.HTTPSConnection, req,

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open

    raise URLError(err)

urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate in certificate chain (_ssl.c:997)>

(p_study) ChangGeuns-MacBook-Pro-15-inch:Python changgeunoh$ 

syncio django python

답변 1

0

좋은사람

안녕하세요.

다른 url을 사용해보세요!

ssl 오류인데요! 또는 python 버전을 3.7 또는 3.8에서 acyncio 버전을 

변경 한 후 실행하시면 정상적으로 동작합니다.

urlopen error [SSL: CERTIFICATE_VERIFY_FAILED

 

진도미확인 (진도가 안 넘어감)

0

51

1

RuntimeError: There is no current event loop in thread 'MainThread'

0

94

1

chapter 07-01 실행 오류

0

77

1

Chapter05-04 : sum_func의 합이 이중 출력됩니다.

0

90

2

45. 병렬성 2 - Futures(5-1) wait가 의도된 대로 동작하지 않습니다.

0

108

2

멀티스레딩 - 44. 병렬성 1 - Futures(4-2)

0

79

2

chapter05_02 클로저 질문사항 !

0

60

1

LV1 설정

0

95

2

매직 메소드의 호출 방법 차이 문의

0

139

2

왜 numbers리스트를 만들때 str으로 숫자를 감싸나요?

0

106

2

스크랩핑 실습 중 Mac OS 인증서 문제

0

137

1

AsyncIO 멀티 스크랩핑 실습 예제 관련 질문

0

176

1

강의자료가 영상과 다릅니다

0

262

2

closure.cell_contents 초기화 하기 문의

0

139

2

map함수 사용 시, list변환 방법 문의

0

352

2

__mul__ 백터 * 숫지, 백터 * 백터 처리

0

149

1

del처리후 질문입니다.

0

162

1

car_list(car1,car2,car3) 인스턴스 tuple 타입 문의

0

234

1

coroutine에 대한 질문

0

250

1

제너레이터 이터레이터 질문이 있습니다.

0

258

1

atom install package search not working

0

283

1

Magic Method - Not Implemented

0

404

1

가상환경 질문!

0

410

1

병렬처리 추가 질문이 있습니다.

0

253

1