public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Arfrever Frehtes Taifersar Arahesis <Arfrever@gentoo.org>
To: Gentoo Development <gentoo-dev@lists.gentoo.org>
Subject: Re: [gentoo-dev] Locale check in python_pkg_setup()
Date: Mon, 2 Aug 2010 23:18:59 +0200	[thread overview]
Message-ID: <201008022319.00534.Arfrever@gentoo.org> (raw)
In-Reply-To: <201007300116.43653.Arfrever@gentoo.org>


[-- Attachment #1.1: Type: Text/Plain, Size: 79 bytes --]

A milder warning will be printed.

-- 
Arfrever Frehtes Taifersar Arahesis

[-- Attachment #1.2: python.eclass.patch --]
[-- Type: text/x-patch, Size: 904 bytes --]

--- python.eclass
+++ python.eclass
@@ -355,6 +355,8 @@
 	# Check if phase is pkg_setup().
 	[[ "${EBUILD_PHASE}" != "setup" ]] && die "${FUNCNAME}() can be used only in pkg_setup() phase"
 
+	local locale
+
 	if [[ "$#" -ne 0 ]]; then
 		die "${FUNCNAME}() does not accept arguments"
 	fi
@@ -407,6 +409,15 @@
 		unset -f python_pkg_setup_check_USE_flags
 	fi
 
+	if [[ "$(locale charmap)" != "UTF-8" ]]; then
+		locale="$(python -c 'import os; print(os.environ.get("LC_ALL", os.environ.get("LC_CTYPE", os.environ.get("LANG", "POSIX"))))')"
+		ewarn
+		ewarn "Currently used locale '${locale}' can cause UnicodeDecodeError or UnicodeEncodeError"
+		ewarn "exceptions. It is recommended to use a UTF-8 locale to avoid problems."
+		ewarn "See http://www.gentoo.org/doc/en/utf-8.xml for information on how to change locale."
+		ewarn
+	fi
+
 	PYTHON_PKG_SETUP_EXECUTED="1"
 }
 

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2010-08-02 21:18 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-29 23:16 [gentoo-dev] Locale check in python_pkg_setup() Arfrever Frehtes Taifersar Arahesis
2010-07-29 23:20 ` "Paweł Hajdan, Jr."
2010-07-30  2:29   ` Arfrever Frehtes Taifersar Arahesis
2010-07-30  3:05     ` "Paweł Hajdan, Jr."
2010-07-30  0:13 ` [gentoo-dev] " Jonathan Callen
2010-07-30  2:32   ` Arfrever Frehtes Taifersar Arahesis
2010-07-30  2:36 ` [gentoo-dev] " Brian Harring
2010-07-31 14:44   ` Arfrever Frehtes Taifersar Arahesis
2010-07-31 19:49     ` Alec Warner
2010-07-31 20:10       ` Arfrever Frehtes Taifersar Arahesis
2010-07-31 20:25         ` Petteri Räty
2010-08-02 21:02           ` Arfrever Frehtes Taifersar Arahesis
2010-08-02 21:40             ` Harald van Dijk
2010-07-30  3:15 ` Krzysztof Pawlik
2010-07-30  3:48   ` Brian Harring
2010-07-30 16:49     ` "Paweł Hajdan, Jr."
2010-07-30 18:45       ` Brian Harring
2010-07-31 21:39       ` James Cloos
2010-07-31 22:04         ` Mike Frysinger
2010-07-31 22:14           ` James Cloos
2010-07-31 22:53             ` Mike Frysinger
2010-07-31 23:30         ` [gentoo-dev] " Jonathan Callen
2010-08-05 14:00           ` James Cloos
2010-07-30 16:05 ` [gentoo-dev] " Harald van Dijk
2010-07-31  3:37 ` Mike Frysinger
2010-08-02 21:18 ` Arfrever Frehtes Taifersar Arahesis [this message]
2010-08-02 21:40   ` Mike Frysinger
2010-08-02 22:08   ` Jeroen Roovers
2010-08-02 22:13   ` Jeroen Roovers
2010-08-03  0:58   ` Brian Harring

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=201008022319.00534.Arfrever@gentoo.org \
    --to=arfrever@gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /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