List for cgit developers and users
 help / color / mirror / Atom feed
From: john at keeping.me.uk (John Keeping)
Subject: [PATCH] filter: set environment variable PYTHONIOENCODING to utf-8
Date: Thu, 9 Mar 2017 00:10:03 +0000	[thread overview]
Message-ID: <20170309001002.GF2102@john.keeping.me.uk> (raw)
In-Reply-To: <c6c11fd1-5903-7986-c5f8-f52747d8b1dc@marples.name>

On Wed, Mar 08, 2017 at 07:01:59PM +0000, Roy Marples wrote:
> On 06/03/2017 09:14, Roy Marples wrote:
> > On 04/03/2017 12:35, John Keeping wrote:
> >> On Thu, Feb 23, 2017 at 03:48:23PM +0000, Roy Marples wrote:
> >>> This allows different versions of Python to be used rather than
> >>> forcing version specific encoding in each script.
> >>>
> >>> Signed-off-by: Roy Marples <roy at marples.name>
> >>> ---
> >>>  filter.c                       | 8 ++++++++
> >>>  filters/email-gravatar.py      | 3 ---
> >>>  filters/syntax-highlighting.py | 5 +----
> >>>  3 files changed, 9 insertions(+), 7 deletions(-)
> >>
> >> Neat!  This definitely makes writing it easier to get it right with
> >> Python filters, but having filter_env_set seems unnecessary.
> >>
> >> Is there a reason not to either:
> >>
> >> 1) set PYTHONIOENCODING unconditionally early in startup
> >>
> >> or
> >>
> >> 2) set the environment in the child after forking
> > 
> > No reason.
> > I went this approach so that it's only set once when needed, happy to
> > re-base my work with either of the two above options.
> 
> Is there anything more you want me to do here?

I was hoping someone else would jump in with an opinion, but this is
quite a quiet mailing list so it might take a while.

Having thought about it a bit more, my vote is for moving the setenv
into the child.  It keeps it where it is being used and I expect most
requests to hit zero or one exec filter(s) so we won't be calling
setenv() multiple times (and if we do, the cost will be dwarfed by the
cost of executing a new process anyway).


  reply	other threads:[~2017-03-09  0:10 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-23 15:48 roy
2017-03-04 12:35 ` john
2017-03-06  9:14   ` roy
2017-03-08 19:01     ` roy
2017-03-09  0:10       ` john [this message]
2017-03-12 17:01         ` Jason
2017-03-12 17:51           ` john
2017-03-17 18:07             ` Jason
2017-03-17 20:04               ` john
2017-03-17 20:13                 ` roy
2017-08-10 14:04                   ` Jason
2017-03-09  0:18 roy
2017-03-10 15:28 ` john

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170309001002.GF2102@john.keeping.me.uk \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).