Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: sitescripts/utils.py

Issue 4790980679041024: Issue 2268 - Deprecate setupStderr() (Closed)
Patch Set: Created April 9, 2015, 8:35 p.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sitescripts/__init__.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sitescripts/utils.py
===================================================================
--- a/sitescripts/utils.py
+++ b/sitescripts/utils.py
@@ -82,8 +82,13 @@
def setupStderr(stream=sys.stderr):
"""
Sets up sys.stderr to accept Unicode characters, redirects error output to
- the stream passed in if any.
+ the stream passed in if any. DEPRECATED
"""
+ import warnings
+ warnings.warn('setupStderr() is deprecated, when directly '
+ 'writing to stderr is problematic use the '
Wladimir Palant 2015/04/09 21:09:03 Maybe a more clear explanation of the issue? 'setu
Sebastian Noack 2015/04/09 21:19:05 Done, but replaced "data" with "text".
+ '"logging" module instead', DeprecationWarning, 2)
+
sys.stderr = codecs.getwriter('utf8')(stream)
def anonymizeMail(email):
« no previous file with comments | « sitescripts/__init__.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld