Can't run files I create and save on mac

Hello there,
I’m an absolute beginner in coding. I can access and run commands on my computer provided by the tutor but if I create and save a simple python code myself like this one:

print('Hello Word')

I get this error:

env: /Users/mansouraoun/Documents/Python3-1.py: Permission denied

I can’t figure out what I’m doing wrong.
Note: I’ve seen that someone had the same issue of mine but it hasn’t been resolved yet and I even tried all the suggested fixes there.

Thanks in advance.

Ok, after some further testing I discovered that all the files created by komodo were missing the execute permission. The tutor’s files were all rwxrwxrwx . Applying chmod 777 to the the files I create solved the problem, but you’ll have to do it manually for every file. Now the question is, how to grant komodo the ability to automatically write files with executable permission ?

Thanks again.

@mansouraoun, check your systems umask. That’s the only way I could see Komodo saving files with the wrong permissions. We don’t do anything special with a files permissions. If it’s not umask please let me know and we can investigate further.

  • Carey

Thanks for the reply Carey. My umask returned 0022. What and how should I configure it so everything works correctly?

That looks fine. What IS the permission of these files before you have to manually change them? Are they brand new files, created in Komodo?

The permission of the file before I change it is rw-r--r-- and yes they are brand new files created in Komodo.

@mansouraoun, I’m a bit slammed today. I’m gonna have to follow up tomorrow.

If you’re interested or have time or both I got to initWithFile in our source. file which is passed into that function has a permissions property. Look for where file is created (might be a Python file called koFile.py or something). However permissions is getting set might be the culprit if it’s a Komodo issue or otherwise point us at to how Komodo is determining permissions based on your system config:

I AM going to follow up on this and the above note is ONLY if you’re interested in investigating as well. If I don’t follow up please do ping back here. #endofsprintblues

  • Carey

Was there ever a resolution to this issue? (“komodo edit won’t save new files with execute permission”)

@bcotrain no change. I’ve never been able to reproduce the issue and as far as I know, no one else if hitting this issue. I assume you’re now seeing it?

2 posts were split to a new topic: Can’t run files in komodo Edit