Hello, we’re iteratively upgrading from pants 2.15...
# general
p
Hello, we’re iteratively upgrading from pants 2.15 -> 2.19 and had some issues when we got to 2.17 where one of our test cases is having a
E       PermissionError: [Errno 13] Permission denied: '/private/var/folders/b1/dns6z6cd7m1dsbxmbhjbqhhh0000gn/T/pants-sandbox-DfG1Za/my_path_to_code_and_tests/test_data/testdoc.docx'
issue. The line that causes the issue is supposed to load ‘testdoc.docx’ into a space that is created/accessed by one of our dependencies.
def genfile(*paths):
'''
Create or open (for read/write) a file path join.
Args:
*paths: A list of paths to join together to make the file.
Notes:
`If the file already exists, the fd returned is opened in ``r+b`` mode.` `Otherwise, the fd is opened in ``w+b`` mode.`
The file position is set to the start of the file.  The user is
`responsible for truncating (``fd.truncate()``) if the existing file` `contents are not desired, or seeking to the end (``fd.seek(0, 2)``)`
to append.
Returns:
io.BufferedRandom: A file-object which can be read/written too.
'''
path = genpath(*paths)
gendir(os.path.dirname(path))
if not os.path.isfile(path):
return io.open(path, 'w+b')
>       return io.open(path, 'r+b')
I’ve also ensured that both file and directory have the necessary read/write permissions as well