Skip to content

Commit

Permalink
misc: use current locale
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrargyrum committed Feb 22, 2024
1 parent 7f67363 commit dd1b0e9
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions count-unsorted/count-unsorted.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@

# count-unsorted: like uniq(1)'s -c but does not require lines to be sorted

import locale
import signal
import sys
from argparse import ArgumentParser
from collections import Counter
from fileinput import input


locale.setlocale(locale.LC_ALL, "")
signal.signal(signal.SIGINT, signal.SIG_DFL)
signal.signal(signal.SIGPIPE, signal.SIG_DFL)

Expand Down
2 changes: 2 additions & 0 deletions elidelong/elidelong
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
# SPDX-License-Identifier: WTFPL

import argparse
import locale
import os
import signal
import sys
Expand All @@ -18,6 +19,7 @@ def has_colors():


def main():
locale.setlocale(locale.LC_ALL, "")
signal.signal(signal.SIGINT, signal.SIG_DFL)
signal.signal(signal.SIGPIPE, signal.SIG_DFL)

Expand Down
2 changes: 2 additions & 0 deletions hexgen/hexgen
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: WTFPL

import binascii
import locale
import os
import re
import signal
Expand Down Expand Up @@ -36,6 +37,7 @@ def main():


if __name__ == '__main__':
locale.setlocale(locale.LC_ALL, "")
signal.signal(signal.SIGINT, signal.SIG_DFL)
signal.signal(signal.SIGPIPE, signal.SIG_DFL)

Expand Down
2 changes: 2 additions & 0 deletions links2markdown/links2markdown.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: WTFPL

import argparse
import locale
import os
import re
import signal
Expand Down Expand Up @@ -82,6 +83,7 @@ def link_to_markdown(m):


def main():
locale.setlocale(locale.LC_ALL, "")
signal.signal(signal.SIGINT, signal.SIG_DFL)
signal.signal(signal.SIGPIPE, signal.SIG_DFL)

Expand Down
2 changes: 2 additions & 0 deletions uniq-unsorted/uniq-unsorted.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# uniq-unsorted: like uniq(1) but does not require lines to be sorted

import locale
import signal
import sys
from fileinput import input
Expand All @@ -11,6 +12,7 @@
seen = set()


locale.setlocale(locale.LC_ALL, "")
signal.signal(signal.SIGINT, signal.SIG_DFL)
signal.signal(signal.SIGPIPE, signal.SIG_DFL)

Expand Down
2 changes: 2 additions & 0 deletions vhd/vhd
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
# rewritten for modernization in 2019

from argparse import ArgumentParser, FileType
import locale
import os
import signal
import sys
Expand Down Expand Up @@ -55,6 +56,7 @@ def print_line(line):


def main():
locale.setlocale(locale.LC_ALL, "")
signal.signal(signal.SIGINT, signal.SIG_DFL)
signal.signal(signal.SIGPIPE, signal.SIG_DFL)

Expand Down

0 comments on commit dd1b0e9

Please sign in to comment.