The Problem is, that you have to add the encoding parametr not only to
the Open Calls but also to the parse calls aswell. Python being non
statically typed does silent conversions otherwise on things like
json.parse or string.decode.


AFAIK only C.UTF-8 is sane for languages such as Python.
Everything else will cause a failure somewhere in the code, as it is
simply too many calls / type conversions. We should ensure that zlogin
(or in general zone enter code) enforces C.UTF-8 as locale and not C.

Greetings
Till

On 11.03.20 07:54, Garrett D'Amore wrote:
> I’m no Python guy, but I think C.UTF-8 is probably the only sane thing
> to do – particularly if you’re going to support things like Unicode file
> names.   I always considered C.UTF-8 to be sort of weird, but this case
> is precisely why you need it.
> 
> Sent from Mail <https://go.microsoft.com/fwlink/?LinkId=550986> for
> Windows 10
> 
> *From: *Alexander Pyhalov via illumos-discuss
> <mailto:[email protected]>
> *Sent: *Tuesday, March 10, 2020 11:25 PM
> *To: *Andy Fiddaman <mailto:[email protected]>
> *Cc: *illumos-discuss <mailto:[email protected]>
> *Subject: *[discuss] pkg, python3 and unicode
> 
> Hi.
> 
> When we initially imported OmniOS CE and Oracle fixes to port PKG to
> Python 3 I considered that only correct way to run it is to run in UTF-8
> environment, as PKG generally treats actions as strings, but never
> specifies encoding for them. I've looked at recent commit to OmniOS CE
> pkg -
> https://github.com/omniosorg/pkg5/commit/93544be96e5c8106bcba71c5436e1464d6d491f0
> , and hoped that it could solve the problem when PKG now and then is run
> in C environment. Usually it happens when it's working with linked
> images. After looking at it for some time I've come to
> https://github.com/OpenIndiana/pkg5/pull/76, but it's still not complete
> - I still can't install package containing unicode actions in C
> environment.
> 
> To actually fix it we should consider that every attrs['path'] is
> unicode and can't be used as-is in rest of the code, if we suppose that
> pkg environment is not UTF-8.
> 
> I'm starting to  wonder if original idea was more sane - just to ensure
> that we always run in UTF-8 environment (especially now, when we have
> C.UTF-8 locale)?
> 
> Best regards,
> 
> Alexander Pyhalov,
> 
> system administrator of Southern Federal University IT department
> 
> *illumos <https://illumos.topicbox.com/latest>* / illumos-discuss / see
> discussions <https://illumos.topicbox.com/groups/discuss> + participants
> <https://illumos.topicbox.com/groups/discuss/members> + delivery options
> <https://illumos.topicbox.com/groups/discuss/subscription> Permalink
> <https://illumos.topicbox.com/groups/discuss/T6f78aa7809ef6ec3-Mfe8b7399028665d1365d2cd8>

------------------------------------------
illumos: illumos-discuss
Permalink: 
https://illumos.topicbox.com/groups/discuss/T6f78aa7809ef6ec3-Mc6947c211b6e602f5a1d2808
Delivery options: https://illumos.topicbox.com/groups/discuss/subscription

Reply via email to