linux - Relative path not working in Python -


my python script can't resolve relative path on linux server in following script:

import boto3 import os  conn = boto3.client('s3', region_name="eu-west-1", endpoint_url="https://example.com", config=config(signature_version="s3", s3={'addressing_style': 'path'})) conn.download_file('mytestbucket22', 'file.csv', os.path.join(os.getcwd(), 'static', 'filecache', 'file.csv')) 

error:

[errno 2] no such file or directory: '/home/vcap/app/static/filecache/file.csv.d3e3d7af' 

however when works , saves file path of script.

conn.download_file('mytestbucket22', 'file.csv', 'file.csv') 

my folder , file structure looks this:

--script.py --static ----filecache 

how can save file folder filecache? thanks

conn.download_file('mytestbucket22', 'file.csv', os.path.join(os.getcwd(), 'static', 'filecache', 'file.csv')) 

documentation references modules, constants , functions used above:


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -