Select to view content in your preferred language

Is there a way I can disable this popup?

255
9
Jump to solution
a week ago
GISDepartmentMFM
Regular Contributor

After updating to the new patch I started getting this popup when I would run toolbox that I'm working on and it is starting to get really annoying because I am banging my head against a new bug in the patch that causes Arcgis to crash if I make an edit to my toolbox, which makes doing development kind of annoying. I just want to know if there is a way to turn off this popup.

GISDepartmentMFM_1-1749049891812.png

 

 

 

0 Kudos
1 Solution

Accepted Solutions
HaydenWelch
MVP Regular Contributor

Since this is a new feature, I think submitting an Idea post about adding a whitelist (say a specific folder) and a toggle in the settings would be helpful. It's already difficult to develop tooling quickly as is, adding this annoying popup without a way to disable it is just more annoyance.

View solution in original post

9 Replies
GISDepartmentMFM
Regular Contributor

 Something cursed I had to implement with the changes to how toolboxes are initialized in the new patch. This doesn't solve my main issue just a sub problem where my toolbox would get fully run if it was opened for the fist time or refreshed.:

def main():
#stops arcgis from fully running toolbox if script is updated or refreshed
try:
aprx = arcpy.mp.ArcGISProject("CURRENT")
except OSError:
tbx = Toolbox()
tool = Tool()
tool.execute(None,None,False)

if __name__ =='__main__':
#breakpoint()
main()
#breakpoint()
HaydenWelch
MVP Regular Contributor

Are you using Python Toolboxes or a standard Model tool with script files?

In my testing the "3rd party code" is handled by the ArcPro interpreter and that code is run before your code is even initialized, so I don't think there's an easy way to avoid it without digging into custom addons that overwrite that behavior.

I do most of my development in .pyt toolboxes, and haven't run into anything causing issues with execution yet. All tools and toolboxes are initialized on refresh though

GISDepartmentMFM
Regular Contributor

Are you on the 3.5.1? I am also using  .pyt toolbox's. I don't know what it is flagging as 3rd party code that it wasn't before. For reference I am having this popup on a toolbox where these are my only libraries I use. 

import arcpy
import arcpy.mp as mp
import os
import sys
import time
import traceback
HaydenWelch
MVP Regular Contributor

It's just any pyt file. If it loads something that wasn't there in initialization of the interpreter it throws up the warning.

ArcPro has some internal functions that start the Python interpreter and whatever system it is that initializes toolboxes is now showing that warning (likely because it is technically a security risk loading in arbitrary code).

I don't have the re-loading issue because I use a custom framework (pytframe2) for managing tools that keeps the pyt file constant (it's essentially a config that dynamically loads in the Tool modules from other files). Seems that it asks every time the contents of the pyt file change.

Edit: Okay, so a reload does still trigger the message. If I accept the message, then close and reopen the project though, I don't get asked again. Even if the code changed (in one of the tool modules, I still get it if the pyt file changes).

HaydenWelch
MVP Regular Contributor

Since this is a new feature, I think submitting an Idea post about adding a whitelist (say a specific folder) and a toggle in the settings would be helpful. It's already difficult to develop tooling quickly as is, adding this annoying popup without a way to disable it is just more annoyance.

GISDepartmentMFM
Regular Contributor

dam this sucks, yeah ill go submit an idea post about a "don't ask again" toggle or an ability to white list a folder of approved toolboxes

AlfredBaldenweck
MVP Regular Contributor

Please share the link here when you do.

0 Kudos
DanPatterson
MVP Esteemed Contributor

From

What's new in ArcGIS Pro 3.5—ArcGIS Pro | Documentation

A warning dialog box appears when you open a custom Python toolbox. System administrators who manage application settings can use the BlockNonSystemPythonToolbox setting to remove this warning.
Warning dialog box when opening a custom Python toolbox
Click Yes to run the toolbox code and load the list of tools and toolbox properties.

So it appears the desire was to put control into administrative hands


... sort of retired...
0 Kudos