6

I have encountered a very strange problem.

I'm working with django, I create a directory on server, and try to save pickle file into it, this way:

with open(path, 'wb') as output: 
  pickle.dump(obj, output, pickle.HIGHEST_PROTOCOL)

And get:

PermissionError: [Errno 13] Permission denied

I tried to give all permissions to this directory, this way:

os.chmod(save_full_path, stat.S_IWOTH | stat.S_IWUSR | stat.S_IWGRP)

but this didn't help.

Although directory seems to have all permissions(0o777), I still get this error.

By the way, I have no problems with saving uploaded files to this directory.

I'm very new to django, I would really appreciate if someone explained me what am I doing wrong.

Olja Muravjova
  • 117
  • 1
  • 7

1 Answers1

0

It seems like i have figured out this myself. Found this question, and did excactly what is written there.

Permission denied when trying to write to file from a view

But I still don't know what was the problem in my case :(

Olja Muravjova
  • 117
  • 1
  • 7