Delta between python3 provided by Apple's Xcode and the one provided by python312 @3.12.4_0+lto+optimizations (active) in macports

brian bholder+macports at gmail.com
Wed Jul 10 11:24:20 UTC 2024


Hi,

I am seeking to understand why this script

import CoreLocation
from time import sleep

location_manager = CoreLocation.CLLocationManager.alloc().init()
location_manager.startUpdatingLocation()

max_wait = 60
# Get the current authorization status for Python
for i in range(1, max_wait):
    authorization_status = location_manager.authorizationStatus()
    print("Authorization status: ", authorization_status)
    if authorization_status == 3 or authorization_status == 4:
        print("Python has been authorized for location services")
        break
    if i == max_wait-1:
        exit("Unable to obtain authorization, exiting")
    sleep(1)

coord = location_manager.location().coordinate()
lat, lon = coord.latitude, coord.longitude
print("Your location is %f, %f" % (lat, lon))

pops an authorization prompt when using Apple's python and not the one in
MacPorts (python312 @3.12.4_0+lto+optimizations) on Ventura. In either
case, the python application appears in
"x-apple.systempreferences:com.apple.settings.PrivacySecurity.extension?Privacy_LocationServices"
for manual authorization but I'd like to understand what causes the
difference in behavior.

N.B. -> The auth prompt that Apple's python pops is -- "Python" would like
to use your current location. Don't allow - button . OK - button.

Thanks.

B
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macports.org/pipermail/macports-users/attachments/20240710/f9a1fa7f/attachment.htm>


More information about the macports-users mailing list