티스토리 뷰
기존코드
..............................................
encoding='utf-8'
이게 해답일까?
결과적으로 해결한 방법은 이것이었다.
이것 찾는데, 3일 걸린것 같다...
알고나니 허무하네요~ 여러분도 혹시 해메는 사람이 있을까해서.. 올려봅니다.
100번은 시도해본 것 같아요~
별의별 수정을 다했는데.. 결국 찾아서 기쁩니다.
오류없이 잘되네요~
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
if __name__ == '__main__':
main()
sys.exit()
100번 넘게 만났던 오류메시지 아니 경고메시지라고 해야 맞을 것 같네요~
C:\python\dist\jamb_ver9\_internal\excel\자동작도 유형별 데이터.xlsm
환영합니다! 프로그램을 실행합니다.
Exception in thread Thread-1 (_forward_stdout):
Traceback (most recent call last):
File "threading.py", line 1016, in _bootstrap_inner
File "threading.py", line 953, in run
File "gooey\gui\processor.py", line 70, in _forward_stdout
File "gooey\gui\processor.py", line 84, in _extract_progress
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc0 in position 41: invalid start byte
수정후 코드
class ProcessController(object):
# ... [이전 코드 유지] ...
def _forward_stdout(self, process):
'''
Reads the stdout of `process` and forwards lines and progress
to any interested subscribers
'''
while True:
line = process.stdout.readline()
if not line:
break
try:
decoded_line = line.decode(self.encoding, errors='replace')
_progress = self._extract_progress(decoded_line)
pub.send_message(events.PROGRESS_UPDATE, progress=_progress)
if _progress is None or self.hide_progress_msg is False:
pub.send_message(events.CONSOLE_UPDATE, msg=decoded_line)
except UnicodeDecodeError as e:
print(f"디코딩 오류: {e}")
pub.send_message(events.EXECUTION_COMPLETE)
# ... [나머지 코드 유지] ...
'IT tech Coding > python' 카테고리의 다른 글
파이썬 묶음으로 함수호출하는 법 x1, y1을 한쌍으로 호출? (0) | 2024.02.26 |
---|---|
파이썬 전역변수 선언하는 시원한 방법 (0) | 2024.02.26 |
[파이썬오류] PermissionError: [WinError 5] 액세스가 거부되었습니다 (0) | 2023.12.15 |
파이썬에서 중복요소가 화면에 있다면 마지막요소만 선택가능한가? selenium 응용편 (0) | 2023.12.04 |
파이썬에서 코딩하다 문자열의 줄바꿈이 있을때 어떻게 처리하나? (0) | 2023.11.30 |
- Total
- Today
- Yesterday
- isset을 적용해야 하는 이유
- #프로그램설치
- 효율적코딩방법
- 테크에능한여성
- Bootstrap 5
- 1. #웹개발 2. #로트번호 3. #성적서보기 4. #ajax 5. #jquery 6. #php 7. #프론트엔드 8. #백엔드 9. #부트스트랩 10. #웹기능구현
- 스크립트작성기초
- 파이썬코드줄바꿈방법
- json파일형태보기
- 캐드자동작도
- ajax오류메시지
- 프로그래머생활
- 엑셀셀보호
- 도면자동생성
- #InstallForge
- sql문장 날짜계산
- #파이썬패키징
- 코딩튜토리얼
- 구글드라이브API
- 오토핫키가이드
- 엑셀보호
- 티스토리챌린지
- 뫄프로그래밍
- chatGPT3.5파이썬버전
- 코딩효율성
- json파일편하게보는법
- 오블완
- 엑셀입력보호
- General error: 2031
- coalesce는 한국어로 "코얼레스크" 또는 "코얼리스"
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |