Open Keiishu opened 5 months ago
Thanks for the report, have you verified if the TypeScript client works for you?
Thanks for your answer. I just tried on a new project, with the TypeScript client, in a path containing an accent, and it works :
FYI, I tried with the latest commit (with Prisma 5.13.0), and it didn't work either
Bug description
When working on Windows, using the latest version of the module, neither
prisma generate
throws an error when there's a non-ASCII character in the path ; for example, a grave accent in the name of a folder.Traceback
``` Traceback (most recent call last): File "C:\Users\Martin\Documents\Universit�\2023-2024\Cours\Q2\Technologies Web\Projet\.venv\Lib\site-packages\prisma\g enerator\generator.py", line 109, in run self._on_request(request) File "C:\Users\Martin\Documents\Universit�\2023-2024\Cours\Q2\Technologies Web\Projet\.venv\Lib\site-packages\prisma\g enerator\generator.py", line 162, in _on_request self.generate(data) File "C:\Users\Martin\Documents\Universit�\2023-2024\Cours\Q2\Technologies Web\Projet\.venv\Lib\site-packages\prisma\g enerator\generator.py", line 251, in generate shutil.copy(data.schema_path, packaged_schema) File "C:\Users\Martin\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 419, in copy copyfile(src, dst, follow_symlinks=follow_symlinks) File "C:\Users\Martin\AppData\Local\Programs\Python\Python311\Lib\shutil.py", line 256, in copyfile with open(src, 'rb') as fsrc: ^^^^^^^^^^^^^^^ FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Martin\\Documents\\Université\\2023-2024\\Cours\\Q2\ \Technologies Web\\Projet\\prisma\\schema.prisma' ```Note the accent in the traceback. Tried in both PowerShell and classic CMD.
This behaviour does not appear on Linux at all.
I tried to debug it myself, because it's certainly a parsing somewhere that isn't working with UTF-8 consistently, but I didn't find what I was trying to find. Where should we look into?
EDIT: I tried to copy the project folder in my main user directory and
prisma db push
, and it worked, but it generated the client in the wrong path. It created a new folder alongside the one with a grave accent, and just put the client there. No "FileNotFoundError".Console session
(.venv) PS C:\Users\Martin\Ceci est un test\Projet> prisma db push Environment variables loaded from .env Prisma schema loaded from prisma\schema.prisma Datasource "db": MongoDB database "lte" at "lte.wmoyioi.mongodb.net" The database is already in sync with the Prisma schema. Running generate... - Prisma Client Python (v0.13.1) ✔ Generated Prisma Client Python (v0.13.1) to .\..\..\Documents\Universit�\2023-2024\Cours\Q2\Technologies Web\Projet\.v env\Lib\site-packages\prisma in 270msHow to reproduce
prisma db push
Expected behavior
The prisma client isn't generated, and we are instead greeted with a FileNotFoundError error, and a new folder on the disk, with every non-ASCII character replaced with a symbol.
Environment & setup