2014-04-09 1 views
1
 import boto 
     from boto.s3.connection import S3Connection 
     import requests 

     conn = S3Connection('-----------------', '-------------------') 
     snapsbucket = conn.get_bucket('snaps-snaps') 

     for key in snapsbucket.list('a'): 
      print key.name  
      print key.generate_url(expires_in=90) 

이렇게하면 파일 이름과 URL 목록이 출력됩니다.Python S3 Boto는 SignatureDoesNotMatch 오류로 URL을 생성합니다.

여기 갇혀
 <Error> 
     <Code>SignatureDoesNotMatch</Code> 
     <Message> 
     The request signature we calculated does not match the signature you provided. Check your key and signing method. 
     </Message> 
     <StringToSignBytes> 
     47 45 54 0a 0a 0a 31 33 39 37 30 38 34 30 35 37 0a 2f 73 6e 61 70 73 2d 73 6e 61 70 73 2f 61 73 73 65 6c 69 6e 70 61 75 6c 5f 61 73 73 65 6c 69 6e 70 61 75 6c 7e 31 33 39 36 39 38 36 38 37 39 34 36 35 2e 6d 70 34 
     </StringToSignBytes> 
     <RequestId>2C2A6E1194BAAD85</RequestId> 
     <HostId> 
     ReNCy1k3OqBd2xyfA5tyixhD7MXnNACqBspsl61IAN7GSF1haK03cv4r6x6WHle/ 
     </HostId> 
     <SignatureProvided>IlRoL9AZJZQYL4/L0wySexMBjnw=</SignatureProvided> 
     <StringToSign> 
     GET 1397084057 /snaps-snaps/asselinpaul_asselinpaul~1396986879465.mp4 
     </StringToSign> 
     <AWSAccessKeyId>--------------</AWSAccessKeyId> 
     </Error> 

, 어떤 도움이 많이 감사 : 나는 URL을 따르 , 나는 다음 XML을받을.

답변

1

내 파일 이름에 물결 기호 (~)가 포함되어 있습니다.

이렇게하면 URL이 엉망이므로 오류가 발생합니다.

+0

이것은 boto 라이브러리의 버그 인 것 같습니다. https://github.com/boto/boto/issues/2849 등을 참조하십시오. – ShreevatsaR

관련 문제