Skip to content

S3Downloader.list() returns malformed URIs under Windows #1501

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
alex23lemm opened this issue May 16, 2020 · 2 comments
Closed

S3Downloader.list() returns malformed URIs under Windows #1501

alex23lemm opened this issue May 16, 2020 · 2 comments
Labels
status: pending release The fix have been merged but not yet released to PyPI type: bug

Comments

@alex23lemm
Copy link

Describe the bug
Instead of a / after the bucket name S3Downloader.list() adds \\ when constructing the URI under Windows resulting in an address that looks as follows:
s3://bucket_name\\models/output/model.tar.gz

To reproduce
I assume that you have set up your credentials underneath ~/.aws on your Windows machine.

conda create --name sagemaker-test
conda activate sagemaker-test
conda install pip
pip install sagemaker
  • Save the following Python script underneath C:\examples\s3downlader.py and modify the S3 URI to test it against your S3 bucket:
import sagemaker

s3_downloader = sagemaker.s3.S3Downloader()
output_path = "s3://[YOUR BUCKET NAME]/models/"
print(s3_downloader.list(output_path))
  • Back in Anaconda Prompt, execute the following command:
python c:\examples\s3downloader.py
  • In my case the result looks as follows:
['s3://[REMOVED_MY_BUCKET_NAME]\\models/sagemaker-train-xgboost-15-May-2020-10-41-44/output/model.tar.gz',
 's3://[REMOVED_MY_BUCKET_NAME]\\models/sagemaker-train-xgboost-15-May-2020-10-41-44/predictions/taxi_test.csv.out']

Expected behavior
In contrast, when I execute the Python script above in a SageMaker notebook, everything works as expected and the response looks as follows:

['s3://[REMOVED_MY_BUCKET_NAME]/models/sagemaker-train-xgboost-15-May-2020-10-41-44/output/model.tar.gz',
 's3://[REMOVED_MY_BUCKET_NAME]/models/sagemaker-train-xgboost-15-May-2020-10-41-44/predictions/taxi_test.csv.out']

System information
A description of your system. Please provide:

  • SageMaker Python SDK version: 1.58.2
  • Python version: 3.7
  • OS: Windows 10
@laurenyu
Copy link
Contributor

I've merged a PR to fix this: #1520. This should be released on Monday morning.

@laurenyu
Copy link
Contributor

released in v1.60.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: pending release The fix have been merged but not yet released to PyPI type: bug
Projects
None yet
Development

No branches or pull requests

2 participants