Issue #19076: Don't pass the redundant 'file' argument to self.error().
Issue #19076: Merge with 3.4.
Issue #21966: Respect -q command-line option when code module is ran.

Contributed by Anton Barkovsky.