OK I finally figured it out... right before I pulled out all my hair.
so for whatever reason it would crash and die when I would call
with open("/sys/class/gpio/gpio141/value","w") as f:
f.write("1")
however if I called it as
os.system("echo 1>/sys/class/gpio/gpio141/value")
it worked fine.
Im still not sure why I would get operation not permitted when I would try to open it as a filehandle