Get[…, Path-> {…}] does not shield against paclets directories

Let's create a test package/paclet in a standard $UserBaseDirectory/Applications: root = FileNameJoin[{$UserBaseDirectory, "Applications", "TestPaclet", ##}]&;

CreateFile @ root["Kernel", "init.m"]
Export[ root["Kernel", "init.m"], "Echo[$InputFileName]", "Text"]; Export[ root["PacletInfo.m"] , Paclet[Name -> "TestPaclet",Version -> "0.0.1", MathematicaVersion -> "11+", Description -> "", Creator -> "Kuba", Extensions -> { {"Kernel", Context -> "TestPaclet"}}] ];  And let's try it: Get["TestPaclet"]; Get["TestPaclet", Path -> {$HomeDirectory}]


>> ...\Applications\TestPaclet\Kernel\init.m

Get::noopen: Cannot open TestPaclet.

$Failed  Before Paclets appeared, Path option for Get shielded against the default $Path. Which I find expected and desired but I can agree it is subjective. Anyway, it is not the case for default paclets repositories:

PacletInstall @ PackPaclet @ root[]

Get["TestPaclet"];

Get["TestPaclet", Path -> {$HomeDirectory}];  Paclet[TestPaclet,0.0.1,<>]  >> ...\Paclets\Repository\TestPaclet-0.0.1\Kernel\init.m >> ...\Paclets\Repository\TestPaclet-0.0.1\Kernel\init.m Considering previous behavior I find the new one a bug. [CASE:4016445] was created • Possible duplicate of$Path hijacked by PacletManager? – ilian Feb 13 '18 at 21:39
• @ilian very closely related but it does not cover Paclets/Repository scenario and Path option. And the real question I have is how to block my Get from paclets directory? If there is no way then there is a serious problem. – Kuba Feb 13 '18 at 21:46
• @ilian ref/Get: "Get[name,Path->{"dir1","dir2", ...}] successively searches for files in each of the diri." so my example exposes at least a documentation bug because the last code line of mine clearly does more. – Kuba Feb 13 '18 at 21:51
• But the previous question also covers overriding $Path and your Paclets/Repository is just where the paclet is, nothing more. – ilian Feb 13 '18 at 21:56 • @ilian I'm abusing the fact the Path (the option) does not say anything about $Path. And again, I don't insist on Get["TestPaclet", Path -> {FileNameJoin[{$UserBaseDirectory, "Applications"}]}] reaching Applications (though that is expected). Where is that (this or linked) behavior documented? If we mark it a duplicate the OP deserves bugs tag. – Kuba Feb 13 '18 at 22:10 1 Answer I'm not going to write an answer, but in terms of getting your desired behavior, try Block[{InternalPacletFindFile}, Get["TestPaclet", Path -> {$HomeDirectory}]]


Get::noopen: Cannot open TestPaclet.

(* \$Failed *)

• Thanks. And re this and FindFile case. It is nowhere documented. Is there any reason not to give it bugs +/- documentation? – Kuba Feb 14 '18 at 7:17
• It’s certainly undocumented, like a great many things about the paclet manager (there is a good Q & A about some of them too). – ilian Feb 14 '18 at 14:16