Hi Ram,
Thanks for doing this; I've been overestimating my ability to get to things over the last couple of weeks.
I've looked at the patch and have made one minor change. I had moved all the imports up to the top, to keep them in one place (and I think some had originally been used only by the Python 2 code. You added them there, but didn't remove them from their original positions. So I've incorporated that into your patch, attached as v2. I've tested this under Python 2 and 3 on Linux, not Windows.
Everything else looks correct. I apologise for not having replied to your question in the original bug report. I had intended to, but as I said, there's been an increase in the things I need to juggle at the moment.
Best wishes,
Hi Hugh,
Please feel free to change it if it requires any changes.