Pytz error: unpack requires a string argument of length 44

Daniel Klein bringa at
Thu Jun 14 03:05:12 CEST 2012

The windows box is my development box, it's not where the script will be running in the end. It'll be running on a Linux box where I don't have root so python install isn't an option (to my understanding).

So what happened is that 7zip didn't unzip the .tar.gz2 properly, but it does fine with the .zip from the Python Package Index. Using the zoneinfo from the properly unzipped file everything works.

Thanks everyone, consider this solved.

On Wednesday, June 13, 2012 11:25:28 PM UTC+1, Prasad, Ramit wrote:
> > There indeed seems to be something wrong with my installation of pytz. I had a
> > look around the zoneinfo dir, which is where build_tzinfo polls its info from,
> > and a whole bunch of files are 0 bytes. Whenever I try to instantiate a
> > timezone whose corresponding file is 0 bytes I get that error (it's trying to
> > read the head of the tzinfo file to make sure the right magic bytes are in
> > there, and reading 44 bytes out of a 0 byte file isn't going to work).
> > 
> > So I guess I'll poke around to find some specific help with pytz or a non-
> > broken zoneinfo dir.
> Did you follow the installation instructions located on the front page?
> I would unpack the tarball (not in a Python directory) and then do 
> `python install` (use the full path to the executable you want
> the module installed to if you have more than one version of Python installed)
> from the directory with the unpacked contents of the tarball. I did not need 
> admin rights to manually install on Windows, but that might depend on 
> where your Python is installed.
> Ramit
> Ramit Prasad | JPMorgan Chase Investment Bank | Currencies Technology
> 712 Main Street | Houston, TX 77002
> work phone: 713 - 216 - 5423
> --
> This email is confidential and subject to important disclaimers and
> conditions including on offers for the purchase or sale of
> securities, accuracy and completeness of information, viruses,
> confidentiality, legal privilege, and legal entity disclaimers,
> available at

More information about the Python-list mailing list