Kaggle / kaggle-api

Official Kaggle API
Apache License 2.0
6.24k stars 1.09k forks source link

Optional -p argument for dataset version subcommand isn't actually optional #79

Closed colinmorris closed 6 years ago

colinmorris commented 6 years ago

Repro:

mkdir -p repro
cd repro
touch hello.csv
kaggle d init
sed -i 's/INSERT_[A-Z]\+_HERE/test123/' dataset-metadata.json
kaggle d create
sleep 10
# Download new metadata file to work around https://github.com/Kaggle/kaggle-api/issues/77
kaggle d metadata colinmorris/test123

kaggle d version -m 'no changes'

The final command results in the following error:

Traceback (most recent call last):
  File "/home/colinmorris/.local/bin/kaggle", line 11, in <module>
    sys.exit(main())
  File "/home/colinmorris/.local/lib/python3.5/site-packages/kaggle/cli.py", line 50, in main
    out = args.func(**command_args)
  File "/home/colinmorris/.local/lib/python3.5/site-packages/kaggle/api/kaggle_api_extended.py", line 978, in dataset_create_version_cli
    delete_old_versions=delete_old_versions)
  File "/home/colinmorris/.local/lib/python3.5/site-packages/kaggle/api/kaggle_api_extended.py", line 912, in dataset_create_version
    if not os.path.isdir(folder):
  File "/usr/lib/python3.5/genericpath.py", line 42, in isdir
    st = os.stat(s)
TypeError: stat: can't specify None for path argument

If I explicitly add -p . to that command, I can avoid this error.

ghost commented 6 years ago

Should be fixed in 1.4.7.1.