BUG: fix loading from compressed .npz (Issue 4093)

In Python 2.6.x the number of bytes read from a zip file is 2^16, which
is less than the 2^18 requested by lib.format.py. This change handles
the case where fp.read() returns fewer than the requested number of bytes.
BUG: Fixes Python3 compatibility
TST: Adds test case for Issue 4093
STY: pep8
MAINT: Better handling of very small chunks

Issue 4093: Improved the handling of the case when the amount of data
read by fp.read is smaller than dtype.itemsize. Also changed the test
code to make sure this case is tested.
MAINT: Introduced _read_array function

This wrapper function is used everywhere in format.py now to ensure to
correctly the handle the case when fp.read returns fewer bytes than
requested.

Also added a test for the orignal bug, loading an array of size more
than 64K from a zip file.
MAINT: Change test to read random sized chunks

Speeds the test up vs. reading single bytes at a time, and is now
correctly handled when reading the magic string and array header.
Merge pull request #4115 from msperlich/master

BUG: fix loading from compressed .npz (Issue 4093)
BUG: Propagate error when assigning an instance to an array item.

Prior to this fix, numpy would swallow an error that may occur when
an instance of an old-style class would be used to set an item in an
incompatible array.  This would result in a SystemError.

Fixes #2276.
Merge pull request #4117 from abalkin/gh-2276

BUG: Propagate error when assigning an instance to an array item.