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

error FS0193: internal error: Illegal characters in path. #1224

Closed
matthid opened this issue May 27, 2016 · 6 comments
Closed

error FS0193: internal error: Illegal characters in path. #1224

matthid opened this issue May 27, 2016 · 6 comments
Labels
Bug good first issue Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Milestone

Comments

@matthid
Copy link
Contributor

matthid commented May 27, 2016

When sending some lines in Visual Studio to fsi the error from the title appears. It seems to be related to binary dependencies and the current-directory variable.
I couldn't reproduce the problem without Visual Studio

Repro steps

  1. open git bash
  2. git clone https://gist.github.com/76cdf91d1e526d63405c05e1f416f35b.git fs0193
  3. cd fs0193
  4. ./build.sh
  5. Now (if everything is green, sorry I couldn't repro without python binaries and a working setup) open FS0193.fsx in Visual Studio 2015 and execute line by line.

Expected behavior

print val it : unit = () and work

Actual behavior

> 


error FS0193: internal error: Illegal characters in path.


error FS0193: internal error: Illegal characters in path.


error FS0193: internal error: Illegal characters in path.
Stopped due to error

Known workarounds

Execute the line again (works second time). Note that everything works in a standalone fsi or when executing the script file directly (which is actually shown in the build script).

Related information

  • FSI: Microsoft (R) F# Interactive version 14.0.23413.0
  • Visual Studio Version 2015 (latest stable)
  • Windows 10 (stable)
  • I would say the impact is low-medium after you figured out it works the second time.
  • You most likely need Windows 64 bit for these particular repro steps otherwise the script will install the wrong native dependency. But I'm pretty sure this would happen on 32 bit as well.
  • You need standard installations or need to edit the build.fsx file because I hardcoded some paths.
  • The script downloads WinPython-64bit-3.5.1.3Zero.exe (~20MB) and installs a portable version
@forki
Copy link
Contributor

forki commented May 27, 2016

I tried to reproduce, but didn't get the described error.

image

@matthid
Copy link
Contributor Author

matthid commented May 27, 2016

@forki Thanks. Seems like your fsi is not running with the correct arch. Can you verify that you have 64 bit enabled.

fsi_options_1
fsi_options_2

Alternatively you can change the build script to download 32 bit versions (of python) and change some hard coded strings ...

@dsyme dsyme added Bug Area-Compiler Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code. labels Jun 28, 2016
@CoFlows
Copy link

CoFlows commented Jun 26, 2018

Specifically for Pythonnet I found that when loading through FSI, the systems tries to load Assemblies with names containing '<' and '>'... this breaks the runtime.
I solved it by editing the assemblymanager.cs file in the pythonnet library and in the LoadAssembly function just return null if certain characters are in the name.....

hope this helps.

        public static Assembly LoadAssembly(string name)
        {
              if(name.Contains("@") || name.Contains("$") || name.Contains("__") || name.Contains("<") || name.Contains(">"))
            
                         return null;

              Assembly assembly = null;
              try
              {
                  assembly = Assembly.Load(name);
              }

@abelbraaksma
Copy link
Contributor

abelbraaksma commented Jun 26, 2018

@QuantApp oops I think your layout got lost. You can surround the code with triple backticks ``` or indent it with four spaces

@CoFlows
Copy link

CoFlows commented Jun 27, 2018

@abelbraaksma thanks for you comment. I have edited above. I hope its not too cryptic... if so please let me know and I will try to add more colour....
Basically the problem is that the Assembly.Load(name) breaks the runtime if the "name" contains strange characters like '<' and '>'... It breaks the runtime even if its around a TRY-CATCH... the FSI runtime also loads many many assemblies that I dont BELIEVE (not sure) are necessary for python net. This is why I filter out names that contains '@', '$' and '__' also....
In my tests... filtering out the characters above brings the initial loading of the Pythonnet runtime from 33seconds to 5seconds in my machine...

@cartermp cartermp added this to the Unknown milestone Aug 25, 2018
@cartermp cartermp modified the milestones: Unknown / not bug, Backlog May 23, 2019
@dsyme
Copy link
Contributor

dsyme commented Mar 31, 2022

I'm going to close this as I went through the original repro and it involves Mono, so would need to update the repro.

@dsyme dsyme closed this as completed Mar 31, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug good first issue Impact-Low (Internal MS Team use only) Describes an issue with limited impact on existing code.
Projects
None yet
Development

No branches or pull requests

6 participants