Hi.
I some times write test code method in Korean.
In test view, cursor can’t run all test at once.
Because of unicode.
This is my solution.
/.cursor/extensions/ms-python.python-2024.12.3-darwin-arm64/python_files/vscode_pytest/run_pytest_script.py
class PipeManager:
def read(self, bufsize=1024) → str:
“”"Read data from the socket.
Args:
bufsize (int): Number of bytes to read from the socket.
Returns:
data (str): Data received from the socket.
"""
if sys.platform == "win32":
# returns a string automatically from read
if not hasattr(self, "_reader"):
self._reader = open(self.name, encoding="utf-8") # noqa: SIM115, PTH123
return self._reader.read(bufsize)
else:
# 바이트 데이터를 누적할 버퍼
buffer = bytearray()
while True:
part = self._socket.recv(bufsize)
if not part:
break
buffer.extend(part)
try:
# 누적된 바이트를 UTF-8로 디코딩 시도
return buffer.decode('utf-8')
except UnicodeDecodeError:
# 디코딩 실패시 더 많은 데이터를 기다림
continue
# 모든 데이터를 받은 후 최종 디코딩
return buffer.decode('utf-8')
Anyway, in the github I found that your code is not fresh.
Please update it.
Thanks.
버전: 0.43.5
커밋: 1.93.1
날짜: 2eaa79a1b14ccff5d1c78a2c358a08be16a8e5a0
Electron: 2024-11-27T09:11:51.854Z
ElectronBuildId: 30.5.1
Chromium: undefined
Node.js: 124.0.6367.243
V8: 20.16.0
OS: 12.4.254.20-electron.0