jldbc / jldbc/pybaseball

download_lahman() failing

Open
#391 9 comments 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
1.7k
Forks
428
PR merge metrics
No merged PRs in 30d

Description

Hi All,

I'm running pybaseball 2.2.7

I'm trying to run pybaseball.people() and getting the following stack trace:

```
---------------------------------------------------------------------------
BadZipFile Traceback (most recent call last)
Cell In[12], line 1
----> 1 download_lahman()

File ~/.local/lib/python3.10/site-packages/pybaseball/lahman.py:30, in download_lahman()
28 def download_lahman():
29 # download entire lahman db to present working directory
---> 30 z = get_lahman_zip()
31 if z is not None:
32 z.extractall(cache.config.cache_directory)

File ~/.local/lib/python3.10/site-packages/pybaseball/lahman.py:25, in get_lahman_zip()
23 elif not _handle:
24 s = requests.get(url, stream=True)
---> 25 _handle = ZipFile(BytesIO(s.content))
26 return _handle

File /usr/lib/python3.10/zipfile.py:1269, in ZipFile.__init__(self, file, mode, compression, allowZip64, compresslevel, strict_timestamps)
1267 try:
1268 if mode == 'r':
-> 1269 self._RealGetContents()
1270 elif mode in ('w', 'x'):
1271 # set the modified flag so central directory gets written
1272 # even if no files are added to the archive
1273 self._didModify = True

File /usr/lib/python3.10/zipfile.py:1336, in ZipFile._RealGetContents(self)
1334 raise BadZipFile("File is not a zip file")
1335 if not endrec:
-> 1336 raise BadZipFile("File is not a zip file")
1337 if self.debug > 1:
1338 print(endrec)

BadZipFile: File is not a zip file
```

I dug around and saw that the data is attempt to be retrieved from here :
https://[github.com/chadwickbureau/baseballdatabank/archive/master.zip](https://github.com/chadwickbureau/baseballdatabank/archive/master.zip)

That is leading to a dead link. Perhaps there was a change upstream.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.