'Getting error Read-only file system: 'CO.dat' in python lambda prgrm

Getting error [Errno 30] Read-only file system: 'CO.dat' in python lambda prgrm while running this portion of code

file_n = 'CO.dat'
s3_client = boto3.client('s3')

with open(file_n, 'wb') as f:       
    s3_client.download_fileobj('dev-itr-uls-weekly-files', key, f)

I tried

with open('/tmp/'+file_n, 'wb') as f: 

which gives error

[Errno 2] No such file or directory: 'tmp/CO.dat'

Please help.



Solution 1:[1]

Sorry it was some file name issue . The code

with open('/tmp/'+file_n, 'wb') as f:

solves

[Errno 30] Read-only file system

Sources

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

Source: Stack Overflow

Solution Source
Solution 1 buddemat