-
Notifications
You must be signed in to change notification settings - Fork 635
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
AGD-1437 Can not preload a package with an apostrophe in its the folder path. #10685
Conversation
@@ -23,6 +23,9 @@ public static string GetDSFullPathName(string fileName, Options options = null) | |||
var trimChars = new[] {'\n','\t','\r',' '}; | |||
fileName = fileName.Trim(trimChars); | |||
|
|||
// Fix file paths which include an apostrophe | |||
fileName = fileName.Replace("\\'", "'"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If I understand it correctly this is replacing \'
with '
, but how would the test case reflect this fix? Maybe I missed something?
{ | ||
LibraryLoaded = false; | ||
|
||
string libraryPath = Path.Combine(TestDirectory, "pkgs", "Pack'age", "bin", @"Package.dll"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@QilongTang This test fails with out the formatting fix
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@saintentropy maybe I misunderstand the issue, how would fileName.Replace("\\'", "'")
help this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry now I get your question @QilongTang. The path here gets modified here
https://github.com/DynamoDS/Dynamo/blob/master/src/Engine/ProtoCore/Utils/CompilerUtils.cs#L258 in TryLoadAssemblyIntoCore
The return value of ToLiteral
is modified from "Pack'age" to "Pack\\'age" when it is parsed here https://github.com/DynamoDS/Dynamo/blob/master/src/Engine/ProtoCore/Utils/CompilerUtils.cs#L242
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Above is one example of the of the call to ToLiteral
@saintentropy or @mrahmaniasl Can you also make it clear if this needs to go into Revit 2021.1 or can be included in the later point release? |
@QilongTang Up to you regarding release. This was originally filed by localization but is not a blocker for GD |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me but I'll wait for @QilongTang review before tagging as LGTM
LGTM |
Purpose
This PR is to resolve an issue found with localized French samples for GD where the included packages would not load into Dynamo. We found while these packages will load during runtime (ie if the user adds a folder to the "Manage Node and Package Paths" dialog) the package will not load upon a restart of Dynamo. This PR adds a fix for the formatted string path which includes an apostrophe used to preload packages during start up.
Declarations
Check these if you believe they are true
*.resx
filesReviewers
@QilongTang @mrahmaniasl
FYIs
@mjkkirschner