Closed JohannesBuchner closed 1 year ago
I can't reproduce this with either a plain csv
or a zip
. I tried it with the sample submission for the same competition. We do not support Python 2 for the API, however. I don't know for sure if that is the problem, but it's possible.
Apparently dput (https://salsa.debian.org/debian/dput) had a similar issue (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=836456) They solved it with this patch:
- if isinstance(stream, io.TextIOBase):
+ if isinstance(stream, file):
+ # Python 2 `file` type doesn't work with the `io` types. Open
+ # the file again with a type we can use.
+ if stream.mode.endswith('b'):
+ text_mode = stream.mode[:-1]
+ else:
+ text_mode = stream.mode
+ fileno = os.dup(stream.fileno())
+ result = io.open(fileno, mode=text_mode, encoding=encoding)
+ elif isinstance(stream, io.TextIOBase):
result = stream
It has something to do with IO streaming. This used to work a a few weeks ago.
Found a simple fix, see PR.
I merged that in, but please be aware that I'm generally not going to make any changes to accommodate Python 2.
I cannot submit any longer with the pypi kaggle commands. I get the following error:
The file is readable. This is on CentOS Linux release 7.4.1708, with Python 2.7.
pip install kaggle --upgrade
did not help. Since it looks like some progressbar, I tried uninstalling tqdm and reinstalling it, but that did not help either.