[1.7.x] Fixed #22523 -- Clarified pytz requirement.

Thanks z for the report and timo for the proposal.

Backport of 0fb7570 from master
[1.7.x] Removed bogus, ineffective 'U' flag from codecs.open() call.

2df7238512 from master.
[1.7.x] Use the new implementation of `six.with_metaclass`.

No more `NewBase` horrors.

Thanks to bendavis78 for his work on merging this into six.

Backport of a2340ac6d6 from master
[1.7.x] Fixed #22447 -- Make sure custom model bases can be migrated.

Thanks to cdestigter for the report.

Backport of 390f888745 from master