用python上传文件到Amazon存储

2024-06-08 08:07:27 发布

您现在位置:Python中文网/ 问答频道 /正文

我上传一个文件到亚马逊存储,虽然这似乎并没有出现,这是很奇怪的。这是给pyupdater的。我唯一的假设是,无论出于何种原因,它要么没有正确加载文件,要么没有加载任何内容。你知道吗

输出:

C:\Users\Hoxton\Pyupdater>pyupdater upload --service s3 setup.py
284 INFO: PyUpdater 2.5.1
[INFO] PyUpdater 2.5.1
289 DEBUG: Config Dir: C:\Users\D1\Pyupdater\.pyupdater
289 DEBUG: Config DB: C:\Users\D1\Pyupdater\.pyupdater\config.pyu
290 DEBUG: Config Dir: C:\Users\D1\Pyupdater\.pyupdater
290 DEBUG: Config DB: C:\Users\D1\Pyupdater\.pyupdater\config.pyu
291 DEBUG: Config Dir: C:\Users\D1\Pyupdater\.pyupdater
291 DEBUG: Config DB: C:\Users\D1\Pyupdater\.pyupdater\config.pyu
292 DEBUG: Config Dir: C:\Users\D1\Pyupdater\.pyupdater
292 DEBUG: Config DB: C:\Users\D1\Pyupdater\.pyupdater\config.pyu
293 INFO: Patch support enabled
[INFO] Patch support enabled
294 WARNING: Version file not found
[WARNING] Version file not found
294 INFO: Created new version file
[INFO] Created new version file
297 INFO: Creating new config file
[INFO] Creating new config file
310 DEBUG: found extension EntryPoint.parse('scp = scp_uploader:SCPUploader')
388 DEBUG: found extension EntryPoint.parse('s3 = s3_uploader:S3Uploader')
488 DEBUG: Setting config variable for region to 'us-west-2'
488 DEBUG: Loading variable profile from defaults.
489 DEBUG: Loading variable config_file from defaults.
490 DEBUG: Loading variable credentials_file from defaults.
491 DEBUG: Loading variable data_path from defaults.
491 DEBUG: Loading variable region from instance vars with value 'us-west-2'.
492 DEBUG: Loading variable profile from defaults.
492 DEBUG: Loading variable ca_bundle from defaults.
492 DEBUG: Loading variable profile from defaults.
492 DEBUG: Loading variable api_versions from defaults.
493 DEBUG: Loading JSON file: c:\users\D1\appdata\local\continuum\miniconda3\lib\site-packages\botocore\data\endpoints.json
495 DEBUG: Loading variable profile from defaults.
518 DEBUG: Loading JSON file: c:\users\D1\appdata\local\continuum\miniconda3\lib\site-packages\botocore\data\s3\2006-03-01\service-2.json
524 DEBUG: Event creating-client-class.s3: calling handler <function add_generate_presigned_post at 0x0000028510A6BC80>
524 DEBUG: Event creating-client-class.s3: calling handler <function lazy_call.<locals>._handler at 0x000002850F9CA6A8>
538 DEBUG: Event creating-client-class.s3: calling handler <function add_generate_presigned_url at 0x0000028510A6BA60>
538 DEBUG: The s3 config key is not a dictionary type, ignoring its value of: None
541 DEBUG: Setting s3 timeout as (60, 60)
542 DEBUG: Loading JSON file: c:\users\D1\appdata\local\continuum\miniconda3\lib\site-packages\botocore\data\_retry.json
543 DEBUG: Registering retry handlers for service: s3
543 DEBUG: Defaulting to S3 virtual host style addressing with path style addressing fallback.
544 DEBUG: Requested uploader: s3
544 INFO: Plugin: S3
[INFO] Plugin: S3
545 INFO: Author: Digital Sapphire
[INFO] Author: Digital Sapphire

Upload Complete

采取的步骤:

SET PYU_AWS_ID=awdwada
SET PYIU_AWS_SECRET=dwadaw
SET PYIU_AWS_BUCKET=updater1
pyupdater settings --endpoints s3-ap-southeast-2.amazonaws.com
pyupdater settings --urls
https://console.aws.amazon.com/s3/buckets/updater1/?region=us-east-2&tab=overview
##Path to where update bucket is
pyupdater settings --company
updater1
pyupdater upload --service s3 setup.py

完整的、相关的code。你知道吗


Tags: fromdebuginfoconfigs3servicevariableusers