This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients Juebo, r.david.murray
Date 2014-06-12.13:14:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
The code is mostly correct as it exists in the calendar module.  You are running into issue 10466.  Per my comment in that issue, it may be possible to put a workaround into the calendar module, but your suggestion isn't it, since your code would leave the locale modified, not restored to its value before the calendar function was called.

What happens if you replace the original setlocale call in __enter__ with a try/except, and if the set fails, redo the set call using ''?  Does the save of oldlocale and its restore work in that case?
Date User Action Args
2014-06-12 13:14:49r.david.murraysetrecipients: + r.david.murray, Juebo
2014-06-12 13:14:49r.david.murraysetmessageid: <>
2014-06-12 13:14:49r.david.murraylinkissue21731 messages
2014-06-12 13:14:49r.david.murraycreate