ID 151160 - nuke.pluginAddPath() ignores backslashes as path delimiters

Follow

Problem summary:
The nuke.pluginAddPath() command doesn't treat the backslash '\' as a path delimiter, so if you add a Windows UNC style path, such as \\netshare\netshare\, then the actual plug-in path that is added will be the location where the command is run from. (i.e. the location of the init.py file containing the command.)

The nuke.pluginAppendPath() command does treat \ as a path delimiter, so UNC paths are added as expected.
 

Customer reported version:
nuke.11.1v4
 

Customer reported platform:
windows10
 

Steps to reproduce:
1. Add the following code to the init.py file in the .nuke directory:


​nuke.pluginAddPath('/tmp/test1')nuke.pluginAddPath('//tmp/test2')nuke.pluginAddPath('\tmp\test3')nuke.pluginAddPath('\\tmp\test4')nuke.pluginAppendPath('\tmp\test5')nuke.pluginAppendPath('\\tmp\test6')

2. Launch Nuke, and then open the Script Editor.
3. Run the following command: nuke.pluginPath()

Workaround:
Use forward slashes for the path. i.enuke.pluginAddPath("//unc/test/path")or use: nuke.pluginAddPath(path.replace("\","/"))
 

Reproduced by Support in:
Nuke 11.2v4 - Windows 10, CentOS 7, macOS 10.13
Nuke 11.2v1 - Windows 10
Nuke 11.1v6 - Windows 10
Nuke 11.1v1 - Windows 10
Nuke 11.0v4 - Windows 10
Nuke 11.0v1 - Windows 10
Nuke 10.5v7 - Windows 10
Nuke 10.5v1 - Windows 10
Nuke 10.0v6 - Windows 10
Nuke 10.0v1 - Windows 10
Nuke 9.0v9 - Windows 10
Nuke 9.0v1 - Windows 10, CentOS 7, macOS 10.13
 

Earliest version tested:
9.0v1 - This issue appears to be in all versions of the product
 

Expected behavior:
The path should be unable to break when setting nuke.pluginAddPath().
 

Actual behavior:
The path will break:


Example paths from steps:['/tmp/test1', '//tmp/test2', 'C:/Users/username/.nuke/\tmp\test3', 'C:/Users/username/.nuke/\\tmp\test4', 'C:/Users/username/.nuke', 'C:\\Program Files\\Common Files/Nuke/7.0/plugins', 'C:\\Program Files\\Common Files/Nuke/7.0/plugins\\Ocula', 'C:\\Program Files\\Common Files/Nuke/7.0/plugins\\Ocula\\3.0', 'C:\\Program Files\\Common Files/Nuke/7.0/plugins\\Ocula\\3.0\\VCRedist', 'C:/Program Files/Nuke7.0v10/plugins/user', 'C:/Program Files/Nuke7.0v10/plugins/icons', 'C:/Program Files/Nuke7.0v10/plugins', '\tmp\test5', '\\tmp\test6']

Note how the \tmp\test3 and \\tmp\test4 paths have been added with the .nuke directory, but not the \tmp\test5 and \\tmp\test6 paths, which were added with nuke.pluginAppendPath().

    We're sorry to hear that

    Please tell us why