pymediainfo icon indicating copy to clipboard operation
pymediainfo copied to clipboard

PyInstaller + macOS: "An error occured while opening" files with special characters

Open leogitpro opened this issue 2 years ago • 5 comments

Hi, I use pymediainfo to extract the information for video. In the development mode. everyting is fine. But when made a application from pyinstaller. when the program read a video file from pure english path will be OK. if the path include chinese chars will be crashed. like: /Users/leo/Movies/测试视频/test01.mp4, or /Users/leo/Movies/测试01.mp4. But the same file copy to /Users/leo/Movies/test01.mp4 will be parsed success. Is there a encode bug?

leogitpro avatar Apr 27 '22 11:04 leogitpro

Hello, that looks like a bug with pyinstaller. Please provide at least a stack trace so I can see what is happening.

sbraz avatar Apr 28 '22 20:04 sbraz

Hi @sbraz , I try to use ffmpeg instead pymediainfo to get the video info in my app. It's works well. Anyway, I have attached a creash report in the attchments. Thanks a lot! pymediainfo_crash.txt .

leogitpro avatar May 01 '22 09:05 leogitpro

Hrm, I'm seeing a similar issue. Some of my app's users (macOS, PyInstaller) are reporting something similar (tracebacks below). I cannot reproduce on Linux, but I'll try on macOS.

Traceback (most recent call last):
  File "openlp/core/lib/mediamanageritem.py", line 602, in on_add_click
  File "openlp/core/lib/mediamanageritem.py", line 623, in add_to_service
  File "openlp/core/lib/mediamanageritem.py", line 663, in build_service_item
  File "openlp/plugins/media/lib/mediaitem.py", line 294, in generate_slide_data
  File "openlp/core/ui/media/mediacontroller.py", line 348, in media_length
  File "pymediainfo/__init__.py", line 496, in parse
RuntimeError: An error occured while opening /Users/user/Te daré lo mejor - Jesús Adrian Romero [Con letra].mp4 with libmediainfo
Traceback (most recent call last):
  File "openlp/core/lib/mediamanageritem.py", line 505, in on_double_clicked
  File "openlp/core/lib/mediamanageritem.py", line 528, in on_preview_click
  File "openlp/core/lib/mediamanageritem.py", line 663, in build_service_item
  File "openlp/plugins/media/lib/mediaitem.py", line 294, in generate_slide_data
  File "openlp/core/ui/media/mediacontroller.py", line 348, in media_length
  File "pymediainfo/__init__.py", line 496, in parse
RuntimeError: An error occured while opening /Users/user/Åsnan & Kossan dansar till ”Jag går på livets väg” av Sofia och Hanna Corneskog.mp4 with libmediainfo

rsnyman avatar Jun 15 '22 16:06 rsnyman

@rsnyman Hi, I really don't know what could happen with PyInstaller. I don't have an OSX system I can test right now. If you could reproduce, it would be nice. I assume, outside of PyInstaller, there won't be a problem.

sbraz avatar Jun 15 '22 20:06 sbraz

@rsnyman any luck reproducing without PyInstaller? If I were to attempt to reproduce this with PyInstaller, how would I do it? EDIT: link to issue: https://gitlab.com/openlp/openlp/-/issues/1041

sbraz avatar Nov 25 '22 22:11 sbraz