From 92e14d7e4a3c832f238e9dbe829f387b87f07412 Mon Sep 17 00:00:00 2001 From: Kurtis Rader Date: Sun, 9 Oct 2016 15:09:44 -0700 Subject: [PATCH] deal with Linux shebang handling The Linux kernel only splits on the first whitespace in the shebang line (unlike BSD which splits on all whitespace). Which means there can be only one argument after the path to the program. --- share/tools/create_manpage_completions.py | 3 ++- share/tools/deroff.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/share/tools/create_manpage_completions.py b/share/tools/create_manpage_completions.py index b8b3aa104..837760262 100755 --- a/share/tools/create_manpage_completions.py +++ b/share/tools/create_manpage_completions.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python -B +#!/usr/bin/env python # -*- coding: utf-8 -*- # Run me like this: ./create_manpage_completions.py /usr/share/man/man{1,8}/* > man_completions.fish @@ -20,6 +20,7 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND import string, sys, re, os.path, bz2, gzip, traceback, getopt, errno, codecs from deroff import Deroffer +sys.dont_write_bytecode = True lzma_available = True try: try: diff --git a/share/tools/deroff.py b/share/tools/deroff.py index 02ba52538..f0fe1be6c 100755 --- a/share/tools/deroff.py +++ b/share/tools/deroff.py @@ -1,4 +1,4 @@ -#!/usr/bin/env python -B +#!/usr/bin/env python # -*- coding: utf-8 -*- """ Deroff.py, ported to Python from the venerable deroff.c """ @@ -6,6 +6,7 @@ import sys, re, string +sys.dont_write_bytecode = True IS_PY3 = sys.version_info[0] >= 3 class Deroffer: