Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcc in position 2273: invalid continuation byte #324

Open
tiandaoyuxi opened this issue Nov 29, 2024 · 1 comment

Comments

@tiandaoyuxi
Copy link

Error handling request
Traceback (most recent call last):
File "D:\Comfy_UI\python_embeded\Lib\site-packages\aiohttp\web_protocol.py", line 479, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\python_embeded\Lib\site-packages\aiohttp\web_app.py", line 569, in _handle
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\python_embeded\Lib\site-packages\aiohttp\web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\ComfyUI\server.py", line 62, in cache_control
response: web.Response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\ComfyUI\server.py", line 140, in origin_only_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\ComfyUI\server.py", line 74, in cors_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\ComfyUI\server.py", line 187, in websocket_handler
await ws.prepare(request)
File "D:\Comfy_UI\python_embeded\Lib\site-packages\aiohttp\web_ws.py", line 211, in prepare
payload_writer = await super().prepare(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\python_embeded\Lib\site-packages\aiohttp\web_response.py", line 453, in prepare
return await self._start(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\python_embeded\Lib\site-packages\aiohttp\web_response.py", line 461, in _start
await self._write_headers()
File "D:\Comfy_UI\python_embeded\Lib\site-packages\aiohttp\web_response.py", line 538, in _write_headers
await writer.write_headers(status_line, self._headers)
File "D:\Comfy_UI\python_embeded\Lib\site-packages\aiohttp\http_writer.py", line 148, in write_headers
self._write(buf)
File "D:\Comfy_UI\python_embeded\Lib\site-packages\aiohttp\http_writer.py", line 81, in _write
raise ClientConnectionResetError("Cannot write to closing transport")
aiohttp.client_exceptions.ClientConnectionResetError: Cannot write to closing transport
Error handling request
Traceback (most recent call last):
File "D:\Comfy_UI\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite\videohelpersuite\server.py", line 79, in view_video
res = subprocess.run([ffmpeg_path] + in_args + ['-t', '0', '-f', 'null', '-'],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "subprocess.py", line 571, in run
subprocess.CalledProcessError: Command '['D:\ffmpeg\bin\ffmpeg.EXE', '-safe', '0', '-i', 'D:\Comfy_UI\ComfyUI\temp\image_sequence_preview.txt', '-t', '0', '-f', 'null', '-']' returned non-zero exit status 4294967274.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "D:\Comfy_UI\python_embeded\Lib\site-packages\aiohttp\web_protocol.py", line 479, in _handle_request
resp = await request_handler(request)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\python_embeded\Lib\site-packages\aiohttp\web_app.py", line 569, in _handle
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\python_embeded\Lib\site-packages\aiohttp\web_middlewares.py", line 117, in impl
return await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\ComfyUI\server.py", line 62, in cache_control
response: web.Response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\ComfyUI\server.py", line 140, in origin_only_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\ComfyUI\server.py", line 74, in cors_middleware
response = await handler(request)
^^^^^^^^^^^^^^^^^^^^^^
File "D:\Comfy_UI\ComfyUI\custom_nodes\ComfyUI-VideoHelperSuite\videohelpersuite\server.py", line 89, in view_video
+ e.stderr.decode("utf-8"))
^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcc in position 2273: invalid continuation byte

AustinMroz added a commit that referenced this issue Nov 29, 2024
I've had underlying concern for a while now that universally using utf-8
isn't correct because it doesn't respect locale and this serves as
fairly strong confirmation. From a little bit of digging, checking seems
as simple as calling `locale.getencoding()`, but the documentation
claims that this is ANSI for windows (meaning changing it would affect
the majority of users). As a result, I've refactored out all the string
decoding to use a common variable and set it to display an escaped
version of any unconvertable characters, but am leaving the format as
utf-8 until I have further information.

See #324
AustinMroz added a commit that referenced this issue Nov 29, 2024
I've had underlying concern for a while now that universally using utf-8
isn't correct because it doesn't respect locale and this serves as
fairly strong confirmation. From a little bit of digging, checking seems
as simple as calling `locale.getencoding()`, but the documentation
claims that this is ANSI for windows (meaning changing it would affect
the majority of users). As a result, I've refactored out all the string
decoding to use a common variable and set it to display an escaped
version of any unconvertable characters, but am leaving the format as
utf-8 until I have further information.

See #324
@AustinMroz
Copy link
Collaborator

Looks like there's two errors here, something wrong with previewing an image sequence, and an incorrect encoding when displaying the error message. I've pushed a fix to ensure the error message will display properly, but this will result in a new error message describing the actual issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants