'Python script for git-clang-format errors in permission denied

I am using Ubuntu 18.04 on VirtualBox and am running a git-clang-format python script (downloaded from https://github.com/llvm-mirror/clang/blob/master/tools/clang-format/git-clang-format) but the script returns an error of permission denied. The script is in ~/bin/ folder which is also added to PATH variable. Python is of version 2.7.17

File "/home/cherbo/bin/git-clang-format", line 600, in <module>
    main()
File "/home/cherbo/bin/git-clang-format", line 170, in main
    style=opts.style)
File "/home/cherbo/bin/git-clang-format", line 397, in run_clang_format_and_save_to_tree
    return create_tree(index_infos, '--index-info')
File "/home/cherbo/bin/git-clang-format", line 411, in create_tree
    for line in input_lines:
File "/usr/lib/python2.7/multiprocessing/pool.py", line 673, in next
    raise value
OSError: [Errno 13] Permission denied

The clang-format v9.0.0 tool is from https://releases.llvm.org/download.html#9.0.0 and is in /projects/tools/clang/ folder which is also added to PATH variable. The permissions for the both are:

ls -l ~/bin/ 
-rwxrw-r-- 1 cherbo cherbo 21272 May 11 13:34 git-clang-format

ls -l /projects/tools/clang/
drwxr-xr-x 3 cherbo cherbo 17 May 11 08:09 clang+llvm-9.0.0-x86_64-linux-gnu-ubuntu-18.04

On searching the internet for this issue it was suggested to update the /dev/shm but it did not help.

drwxrwxrwt 2 root root 140 May 11 13:53 /dev/shm/

How can I resolve this issue?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source