title: Cannot download_file from S3 to lambda after notification that S3 object was created
body: <p>I have configured SES to put some emails into S3 bucket and set a S3 trigger to fire lambda function on object created. In lambda, I need to parse and process the email. Here is my lambda (relevant part):</p>
  
  <pre><code>s3client = boto3.client('s3')
  def lambda_handler(event, context):
      my_bucket = s3.Bucket(‘xxxxxxxx')
      my_key = event['Records'][0]['s3']['object']['key']
      filename = '/tmp/'+ my_key
      logger.info('Target file: ' + filename)
      s3client.download_file(my_bucket, my_key, filename)
  #   Process email file
  </code></pre>
  
  <p>download_file throws an exception:</p>
  
  <pre><code>expected string or bytes-like object: TypeError
  
  
  Traceback (most recent call last):
  File "/var/task/lambda_function.py", line 22, in lambda_handler
  s3client.download_file(my_bucket, my_key, filename)
  
  ...
  
  File "/var/runtime/botocore/handlers.py", line 217, in validate_bucket_name
  if VALID_BUCKET.search(bucket) is None:
  TypeError: expected string or bytes-like object
  </code></pre>
  
  <p>Any idea what is wrong? The bucket is fine, object exists in the bucket.</p>