The Wayback Machine - https://web.archive.org/web/20240105224513/https://github.com/pythonnet/pythonnet/issues/2103
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

Long file path support in .Net through pythonnet #2103

Closed
Pierre-M-A-Henry opened this issue Feb 16, 2023 · 1 comment
Closed

Long file path support in .Net through pythonnet #2103

Pierre-M-A-Henry opened this issue Feb 16, 2023 · 1 comment

Comments

@Pierre-M-A-Henry
Copy link

Pierre-M-A-Henry commented Feb 16, 2023

Environment

  • Pythonnet version: 3.0.1
  • Python version: 3.11
  • Operating System: Windows 10 Entreprise
  • .NET Runtime: Framework 4.8

Details

Hello,
We have a .Net Framework API (which is a collection of dlls) that is used by our customers through Python using pythonnet. Our .Net application is files based, and file paths are passed from Python to .Net, and .Net then opens and manipulates the files.

When using a .Net Framework exe client (no python involved), we are able to open files with long file paths (> 260 characters), either by making our exe longPathAware, or by using the \\?\ prefix.

However we cannot get this to work when calling our dlls from python using pythonnet. I understand that python.exe is itself longPathAware (since python 3.6), but using long paths does not seem to work, with or without the \\?\ prefix. Once in the .Net world, functions such as File.Exists would return false.

Would there be any difference in the .net runtime as loaded by pythonnet vs a .net framework exe that might explain this difference?

Many thanks for your help
Pierre Henry

@lostmsu
Copy link
Member

lostmsu commented May 5, 2023

Not a bug. Duplicate of #1754

@lostmsu lostmsu closed this as completed May 5, 2023
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