forked from sopel-irc/sopel
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Make it a bit harder to run into the LC_ALL thing
This behavior is stupid. Respecting LC_ALL, or anything else for that matter, over the encoding fucking noted in the fucking file is a bad decision, and someone should feel bad. I don't know why it makes things break in the specific and bizarre way it does, but it does, and there's no possible good reason for it. Closes sopel-irc#984. Fuck.
- Loading branch information
Showing
2 changed files
with
14 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
# coding=utf-8 | ||
# ASCII ONLY IN THIS FILE THOUGH!!!!!!! | ||
# Python does some stupid bullshit of respecting LC_ALL over the encoding on the | ||
# file, so in order to undo Python's ridiculous fucking idiocy, we have to have | ||
# our own check. | ||
|
||
# Copyright 2008, Sean B. Palmer, inamidst.com | ||
# Copyright 2012, Elsie Powell, http://embolalia.com | ||
# Copyright © 2012, Elad Alfassa <[email protected]> | ||
# Copyright 2012, Elad Alfassa <[email protected]> | ||
# | ||
# Licensed under the Eiffel Forum License 2. | ||
|
||
from __future__ import unicode_literals, absolute_import, print_function, division | ||
import os | ||
import sys | ||
if hasattr(os, "getenv") and os.getenv("LC_ALL") == "C": | ||
print('WARNING!!! LC_ALL is set to "C", which makes Python do stupid ' | ||
'things. If you get strange errors, please unset it, or set it to ' | ||
'something like "en_US.UTF-8".', file=sys.stderr) | ||
|
||
|
||
from collections import namedtuple | ||
import os | ||
import re | ||
import time | ||
import traceback | ||
|