Fixed #22551 -- Made oracle backend method Python 3 compatible

Thanks fatal10110 at gmail.com for the report. The fix is 1.6-only
because that code has been refactored in 1.7 (6983201cfb).
'Docs-only' forward port of 120a98120 from 1.6.x.