Unicode paths results in "No such file or directory" #63853

Closed
opened 2019-04-24 13:54:56 +02:00 by T.L · 19 comments

Hello,

Operating system: Windows 10
Graphics card: Quadro M1200 + Intel HD 530 (but this is not relevant)
Blender version: 2.79b (Date: 2018-03-22, Hash: f4dc9f9d68)
Error:

I try to open a blender file using the command line (for scripting), and the current working directory (D:\Dev\Thèse\article) has accents in it, which are mangled by blender. Additionally, I give it a python script for which a similar error occur. Here is what I tried on cmd:

  D:\Dev\Thèse\article> blender scene.blend --python render.py
  Error: Cannot read file 'D:\Dev\ThÞse\article\scene.blend': No such file or directory
  ... opened default scene instead; saving will write to D:\Dev\ThÞse\article\scene.blend
  WARNING: D:\Dev\ThÞse\article\render.py is not utf path. Please update it.
  Saved: 'D:\Dev\ThÞse\article\result.png'

So:

  • Thèse got mangled to ThÞse,
  • the supplied blend file was not loaded,
  • somehow the python script (which is in the same folder as the blend file) is loaded, but with a warning,
  • the script launch a rendering and should save the result to result.png, but the image is actually not saved...

Seems like just a problem about unicode paths (I don't know the Blender internals though).

Hello, **Operating system**: Windows 10 **Graphics card**: Quadro M1200 + Intel HD 530 (but this is not relevant) **Blender version:** 2.79b (Date: 2018-03-22, Hash: f4dc9f9d68b) **Error**: I try to open a blender file using the command line (for scripting), and the current working directory (`D:\Dev\Thèse\article`) has accents in it, which are mangled by blender. Additionally, I give it a python script for which a similar error occur. Here is what I tried on cmd: ``` D:\Dev\Thèse\article> blender scene.blend --python render.py ``` ``` Error: Cannot read file 'D:\Dev\ThÞse\article\scene.blend': No such file or directory ... opened default scene instead; saving will write to D:\Dev\ThÞse\article\scene.blend WARNING: D:\Dev\ThÞse\article\render.py is not utf path. Please update it. Saved: 'D:\Dev\ThÞse\article\result.png' ``` So: - `Thèse` got mangled to `ThÞse`, - the supplied blend file was not loaded, - somehow the python script (which is in the same folder as the blend file) is loaded, but with a warning, - the script launch a rendering and should save the result to `result.png`, but the image is actually not saved... Seems like just a problem about unicode paths (I don't know the Blender internals though).
Author

Added subscriber: @T.L

Added subscriber: @T.L
Member

Added subscriber: @JacquesLucke

Added subscriber: @JacquesLucke
Member

I could not reproduce the issue in Blender 2.79b and 2.80.

Does the same issue happen when only the .blend file has accents in its name? If yes, can you upload such a .blend file please (just to be sure, that we have the same symbol in the file name).

I could not reproduce the issue in Blender 2.79b and 2.80. Does the same issue happen when only the .blend file has accents in its name? If yes, can you upload such a .blend file please (just to be sure, that we have the same symbol in the file name).
Author

I just tried on another computer with Windows 10, with a file named scène.blend (it is just the default scene, with a simple cube). I did not use python in this second test.

I put this blend file in two folder, so that on path is ascii-only, the other includes an accent (expérience):

  D:\Dev\temp\
      + scène.blend
      + expérience\
          + scène.blend

First file

Work as intended:

  D:\Dev\temp>blender scène.blend
  Read prefs: C:\Users\Thibault\AppData\Roaming\Blender Foundation\Blender\2.79\config\userpref.blend
  found bundled python: C:\Program Files\Blender Foundation\Blender\2.79\python
  Read blend: D:\Dev\temp\scène.blend

Second file

Does not load:

  D:\Dev\temp>cd expérience
  D:\Dev\temp\expérience>blender scène.blend
  Read prefs: C:\Users\Thibault\AppData\Roaming\Blender Foundation\Blender\2.79\config\userpref.blend
  found bundled python: C:\Program Files\Blender Foundation\Blender\2.79\python
  Error: Cannot read file 'D:\Dev\temp\expÚrience\sc├¿ne.blend': No such file or directory
  ... opened default scene instead; saving will write to D:\Dev\temp\expÚrience\sc├¿ne.blend

So it seems to be only affected by accents in the folder, not in the filename.

I just tried on another computer with Windows 10, with a file named `scène.blend` (it is just the default scene, with a simple cube). I did not use python in this second test. I put this blend file in two folder, so that on path is ascii-only, the other includes an accent (exp**é**rience): ``` D:\Dev\temp\ + scène.blend + expérience\ + scène.blend ``` First file ---- Work as intended: ``` D:\Dev\temp>blender scène.blend ``` ``` Read prefs: C:\Users\Thibault\AppData\Roaming\Blender Foundation\Blender\2.79\config\userpref.blend found bundled python: C:\Program Files\Blender Foundation\Blender\2.79\python Read blend: D:\Dev\temp\sc├¿ne.blend ``` Second file -------- Does not load: ``` D:\Dev\temp>cd expérience ``` ``` D:\Dev\temp\expérience>blender scène.blend ``` ``` Read prefs: C:\Users\Thibault\AppData\Roaming\Blender Foundation\Blender\2.79\config\userpref.blend found bundled python: C:\Program Files\Blender Foundation\Blender\2.79\python Error: Cannot read file 'D:\Dev\temp\expÚrience\sc├¿ne.blend': No such file or directory ... opened default scene instead; saving will write to D:\Dev\temp\expÚrience\sc├¿ne.blend ``` So it seems to be only affected by accents **in the folder**, not in the filename.
Author

scène.blend Here is the file with accent (but, as said, only the folder part of the path seems relevant here)

[scène.blend](https://archive.blender.org/developer/F6975796/scène.blend) Here is the file with accent (but, as said, only the folder part of the path seems relevant here)
Member

Thanks. Unfortunately, I still can't reproduce it (on Ubuntu 18.04).

Can you check if the same problem exists in Blender 2.8?
Does the same problem happen when you use Powershell?

Thanks. Unfortunately, I still can't reproduce it (on Ubuntu 18.04). Can you check if the same problem exists in Blender 2.8? Does the same problem happen when you use Powershell?
Author

Thanks. Unfortunately, I still can't reproduce it (on Ubuntu 18.04).

Oh, I see, maybe there is some mismatch between utf8 on Ubuntu and utf16 on Windows/NTFS ?
Exact same behavior with Powershell. However, double-clicking the file in the file explorer works as intended.

I need to install Blender 2.8 to test, I'll keep you informed.

> Thanks. Unfortunately, I still can't reproduce it (on Ubuntu 18.04). Oh, I see, maybe there is some mismatch between utf8 on Ubuntu and utf16 on Windows/NTFS ? Exact same behavior with Powershell. However, double-clicking the file in the file explorer works as intended. I need to install Blender 2.8 to test, I'll keep you informed.
Member

Added subscriber: @LazyDodo

Added subscriber: @LazyDodo
Member

Can't repro on 2.8 on windows

k:\BlenderGit\build_windows_Full_x64_vc15_Release\bin\Release>blender f:\btest\scène.blend
Read prefs: C:\Users\Ray\AppData\Roaming\Blender Foundation\Blender\2.80\config\userpref.blend
AL lib: (EE) ALCmmdevPlayback_resetProxy: Audio client returned buffer_len < period*2; expect break up
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead
found bundled python: k:\BlenderGit\build_windows_Full_x64_vc15_Release\bin\Release\2.80\python
Main register!
Read blend: f:\btest\scène.blend
Saved session recovery to 'C:\Users\Ray\AppData\Local\Temp\quit.blend'

Blender quit

k:\BlenderGit\build_windows_Full_x64_vc15_Release\bin\Release>blender f:\btest\expérience\scène.blend
Read prefs: C:\Users\Ray\AppData\Roaming\Blender Foundation\Blender\2.80\config\userpref.blend
AL lib: (EE) ALCmmdevPlayback_resetProxy: Audio client returned buffer_len < period*2; expect break up
AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead
found bundled python: k:\BlenderGit\build_windows_Full_x64_vc15_Release\bin\Release\2.80\python
Main register!
Read blend: f:\btest\expérience\scène.blend
Can't repro on 2.8 on windows ``` k:\BlenderGit\build_windows_Full_x64_vc15_Release\bin\Release>blender f:\btest\scène.blend Read prefs: C:\Users\Ray\AppData\Roaming\Blender Foundation\Blender\2.80\config\userpref.blend AL lib: (EE) ALCmmdevPlayback_resetProxy: Audio client returned buffer_len < period*2; expect break up AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead found bundled python: k:\BlenderGit\build_windows_Full_x64_vc15_Release\bin\Release\2.80\python Main register! Read blend: f:\btest\sc├¿ne.blend Saved session recovery to 'C:\Users\Ray\AppData\Local\Temp\quit.blend' Blender quit k:\BlenderGit\build_windows_Full_x64_vc15_Release\bin\Release>blender f:\btest\expérience\scène.blend Read prefs: C:\Users\Ray\AppData\Roaming\Blender Foundation\Blender\2.80\config\userpref.blend AL lib: (EE) ALCmmdevPlayback_resetProxy: Audio client returned buffer_len < period*2; expect break up AL lib: (EE) UpdateDeviceParams: Failed to set 48000hz, got 44100hz instead found bundled python: k:\BlenderGit\build_windows_Full_x64_vc15_Release\bin\Release\2.80\python Main register! Read blend: f:\btest\exp├⌐rience\sc├¿ne.blend ```
Author

I tried with Blender 2.8, the version that I downloaded today (5 13b71c89ad0, I separated the digits to avoid another unrelated ticket !):

  • D:\Dev\temp>blender scène.blend WORKS
  • D:\Dev\temp>blender expérience/scène.blend WORKS
  • D:\Dev\temp>blender expérience\scène.blend WORKS
  • D:\Dev\temp\expérience>blender scène.blend FAILS (Error: Cannot read file D:\Dev\temp\expÚrience\sc├¿ne.blend: No such file or directory)

It seems to fail only if the current working directory contains non-ascii characters.

I tried with Blender 2.8, the version that I downloaded today (5 13b71c89ad0, I separated the digits to avoid another unrelated ticket !): - **`D:\Dev\temp>`**`blender scène.blend` WORKS - **`D:\Dev\temp>`**`blender expérience/scène.blend` WORKS - **`D:\Dev\temp>`**`blender expérience\scène.blend` WORKS - **`D:\Dev\temp\expérience>`**`blender scène.blend` FAILS (Error: Cannot read file `D:\Dev\temp\expÚrience\sc├¿ne.blend`: No such file or directory) It seems to fail only if the current working directory contains non-ascii characters.
Member

Can confirm this on windows. @JacquesLucke can you try on linux?

Can confirm this on windows. @JacquesLucke can you try on linux?

Added subscriber: @rjg

Added subscriber: @rjg

It's quite possible that this isn't a bug in blender, but another case of the strange way Windows handles encoding / code pages. Depending on your locale, it may be that è is not included in your code page, which results in Windows replacing the character with ? when passing the argument to the program. If that is the case, then there is nothing blender can do, because it's not getting the right string. You can check if that's the case by temporarily activating the UTF-8 beta feature described here. If that works properly, it's Windows' fault.

It's quite possible that this isn't a bug in blender, but another case of the strange way Windows handles encoding / code pages. Depending on your locale, it may be that `è` is not included in your code page, which results in Windows replacing the character with `?` when passing the argument to the program. If that is the case, then there is nothing blender can do, because it's not getting the right string. You can check if that's the case by temporarily activating the UTF-8 beta feature described [here.](https://github.com/robertguetzkow/libtrashcan/issues/2#issuecomment-486774921) If that works properly, it's Windows' fault.

Seems to be a different cause.

Seems to be a different cause.
Author

Depending on your locale, it may be that è is not included in your code page

I'm on a french Windows, and by default my code page is 850, which includes these characters.

Windows replacing the character with ? when passing the argument to the program. If that is the case, then there is nothing blender can do, because it's not getting the right string

This seems improbable though: the arguments and the current working directory should have the same encoding (Windows-wise), but for some reason Blender only understands the arguments correctly, not the working dir...

> Depending on your locale, it may be that `è` is not included in your code page I'm on a french Windows, and by default my code page is 850, which includes these characters. > Windows replacing the character with ? when passing the argument to the program. If that is the case, then there is nothing blender can do, because it's not getting the right string This seems improbable though: the arguments and the current working directory should have the same encoding (Windows-wise), but for some reason Blender only understands the arguments correctly, not the working dir...

@T.L Yes you're right, that's why I wrote that it seems to be a different cause.

@T.L Yes you're right, that's why I wrote that it seems to be a different cause.
Member

I cannot reproduce it here.

jacques@jacques:~/Downloads/Thèse$ /home/jacques/blender-git/build_linux_debug/bin/blender mythèse.blend
Color management: using fallback mode for management
ndof: spacenavd not found
Read prefs: /home/jacques/.config/blender/2.80/config/userpref.blend
found bundled python: /home/jacques/blender-git/build_linux_debug/bin/2.80/python
Read blend: /home/jacques/Downloads/Thèse/mythèse.blend
Saved session recovery to '/home/jacques/tmp/quit.blend'

Blender quit

Marking as confirmed, because @LazyDodo reproduced it.

I cannot reproduce it here. ``` jacques@jacques:~/Downloads/Thèse$ /home/jacques/blender-git/build_linux_debug/bin/blender mythèse.blend Color management: using fallback mode for management ndof: spacenavd not found Read prefs: /home/jacques/.config/blender/2.80/config/userpref.blend found bundled python: /home/jacques/blender-git/build_linux_debug/bin/2.80/python Read blend: /home/jacques/Downloads/Thèse/mythèse.blend Saved session recovery to '/home/jacques/tmp/quit.blend' Blender quit ``` Marking as confirmed, because @LazyDodo reproduced it.

This issue was referenced by 941575b1f7

This issue was referenced by 941575b1f7ddbb981a35167c2fda29db4a41cf96
Member

Changed status from 'Open' to: 'Resolved'

Changed status from 'Open' to: 'Resolved'
Sign in to join this conversation.
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
5 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#63853
No description provided.