[
https://issues.apache.org/jira/browse/ARROW-18290?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17633809#comment-17633809
]
Miles Granger commented on ARROW-18290:
---------------------------------------
Seems like it works fine:
(using the same docker emulator as OP)
{code:python}
In [2]: import boto3
In [3]: session = boto3.session.Session()
In [4]: client = session.client(service_name="s3",
aws_access_key_id="AKIAIOSFODNN7EXAMPLE", a
...: ws_secret_access_key="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY",
endpoint_url="http://
...: localhost:9444")
In [5]: with open('spam=ham', 'wb') as f:
...: f.write(b'hello')
...:
In [6]: client.upload_file('./spam=ham', 'bucket', 'spam=ham')
In [7]: client.list_objects_v2(Bucket='bucket')
Out[7]:
{'ResponseMetadata': {'HTTPStatusCode': 200,
'HTTPHeaders': {'transfer-encoding': 'chunked',
'content-type': 'application/xml',
'cache-control': 'no-cache, max-age=0',
'last-modified': 'Mon, 14 Nov 2022 13:49:53 GMT',
'connection': 'keep-alive',
'server': 'e72f66e1b191 (scireum SIRIUS - powered by Netty)',
'p3p': 'CP="This site does not have a p3p policy."',
'vary': 'origin'},
'RetryAttempts': 0},
'IsTruncated': False,
'Contents': [{'Key': 'spam=ham',
'LastModified': datetime.datetime(2022, 11, 14, 13, 48, 54, tzinfo=tzutc()),
'ETag': '5d41402abc4b2a76b9719d911017c592',
'Size': 5,
'StorageClass': 'STANDARD'}],
'Name': 'bucket',
'Prefix': '',
'MaxKeys': 1000}
{code}
> [Python] `pyarrow.fs.copy_files` doesn't work if filenames contain special
> characters
> -------------------------------------------------------------------------------------
>
> Key: ARROW-18290
> URL: https://issues.apache.org/jira/browse/ARROW-18290
> Project: Apache Arrow
> Issue Type: Bug
> Components: C++, Python
> Affects Versions: 6.0.1
> Reporter: Balaji Veeramani
> Priority: Minor
>
> I can't upload a file called `spam=ham` to a filesystem that emulates an S3
> API. I can workaround the issue by renaming the file `spam-ham`.
> To reproduce, run a filesystem that emulates an S3 API:
> {code:java}
> docker run -p 9444:9000 scireum/s3-ninja:latest
> {code}
> Authenticate with the filesystem:
> {code:java}
> export AWS_ACCESS_KEY_ID="AKIAIOSFODNN7EXAMPLE"
> export AWS_SECRET_ACCESS_KEY="wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
> {code}
> Then run this Python script:
> {code:python}
> import os
> import tempfile
> import pyarrow.fs
> source = tempfile.mkdtemp()
> file_path = os.path.join(source, "spam=ham")
> open(file_path, "w").close()
> filesystem, path = pyarrow.fs.FileSystem.from_uri(
> "s3://bucket?scheme=http&endpoint_override=localhost:9444"
> )
> pyarrow.fs.copy_files(source, path, destination_filesystem=filesystem)
> {code}
> You'll get the error
> {code:java}
> OSError: When initiating multiple part upload for key 'spam=ham' in bucket
> 'bucket': AWS Error [code 22]: The computed request signature does not match
> the one provided. Check login credentials. (Expected:
> e70ab9efb620f744abd43d13e8e6846c585a41da543bfb5da67d2fe1ccfd1aaa, Found:
> 648456e3441dad5a014b2981c71b6e69ccac9732bdcdbe2d363d95105d914340)
> {code}
> This issue is motivated by [https://github.com/ray-project/ray/issues/29845].
--
This message was sent by Atlassian Jira
(v8.20.10#820010)