From ecdf8da9c62ec64c9bdf80c7aec989a5bc8d4397 Mon Sep 17 00:00:00 2001 From: Raivis Dejus Date: Sun, 18 May 2025 14:11:40 +0300 Subject: [PATCH] Fix for UTF characters in file path (#1169) --- CONTRIBUTING.md | 26 +++++++++----------------- buzz/transcriber/file_transcriber.py | 2 +- 2 files changed, 10 insertions(+), 18 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index fb639471..d40a9ec6 100755 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -97,23 +97,15 @@ Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManage 2. Install the GNU make. `choco install make` 3. Install the ffmpeg. `choco install ffmpeg` 4. Install [MSYS2](https://www.msys2.org/), follow [this guide](https://sajidifti.medium.com/how-to-install-gcc-and-gdb-on-windows-using-msys2-tutorial-0fceb7e66454). -5. Install Poetry, paste this info Windows PowerShell line by line. [More info](https://python-poetry.org/docs/) -``` -(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | py - - -[Environment]::SetEnvironmentVariable("Path", $env:Path + ";%APPDATA%\pypoetry\venv\Scripts", "User") - -Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser -``` -6. Add poetry to PATH. `%APPDATA%\Python\Scripts` -7. Restart Windows. -8. Clone the repository `git clone --recursive https://github.com/chidiwilliams/buzz.git` -9. Enter repo folder `cd buzz` -10. Activate the virtual environment `poetry shell` -11. Install the dependencies `poetry install` -12. `cp -r .\dll_backup\ .\buzz\` -13. Build Buzz `poetry build` -14. Run Buzz `python -m buzz` +5. Clone the repository `git clone --recursive https://github.com/chidiwilliams/buzz.git` +6. Enter repo folder `cd buzz` +7. Create virtual environment `python -m venv venv` (needs to be done only the first time) +8. Activate the virtual environment `.\venv\Scripts\activate` +9. Install Poetry `pip install poetry` +10. Install the dependencies `poetry install` +11. `cp -r .\dll_backup\ .\buzz\` +12. Build Buzz `poetry build` +13. Run Buzz `python -m buzz` Note: It should be safe to ignore any "syntax errors" you see during the build. Buzz will work. Also you can ignore any errors for FFmpeg. Buzz tries to load FFmpeg by several different means and some of them throw errors, but FFmpeg should eventually be found and work. diff --git a/buzz/transcriber/file_transcriber.py b/buzz/transcriber/file_transcriber.py index 28904c4e..804bc254 100755 --- a/buzz/transcriber/file_transcriber.py +++ b/buzz/transcriber/file_transcriber.py @@ -148,7 +148,7 @@ def write_output( len(segments), ) - with open(path, "w", encoding="utf-8") as file: + with open(os.fsencode(path), "w", encoding="utf-8") as file: if output_format == OutputFormat.TXT: combined_text = "" previous_end_time = None