python 2.7 and unicode (one more time)

2014-11-20 Thread Francis Moreau
Hello, My application is using gettext module to do the translation stuff. Translated messages are unicode on both python 2 and 3 (with python2.7 I had to explicitely asked for unicode). A problem arises when formatting those messages before logging them. For example: log.debug("%s: %s" % (hea

Re: python 2.7 and unicode (one more time)

2014-11-20 Thread Francis Moreau
Hi, On 11/20/2014 11:47 AM, Chris Angelico wrote: > On Thu, Nov 20, 2014 at 8:40 PM, Francis Moreau > wrote: >> My question is: how should this be fixed properly ? >> >> A simple solution would be to force all strings passed to the >> logger to be unico

Re: python 2.7 and unicode (one more time)

2014-11-21 Thread Francis Moreau
On 11/20/2014 04:15 PM, Chris Angelico wrote: > On Fri, Nov 21, 2014 at 1:14 AM, Francis Moreau > wrote: >> Hi, >> >> Thanks for the "from __future__ import unicode_literals" trick, it makes >> that switch much less intrusive. >> >> However it

Decoding a process output

2014-03-04 Thread Francis Moreau
Hi, In my understanding (I'm relatively new to python), I need to decode any bytes data provided, in my case, by a shell command (such as findmnt) started by the subprocess module. The goal of my application is to parse the command outputs. My application runs only on linux BTW and should run fin

Re: Decoding a process output

2014-03-05 Thread Francis Moreau
On 03/04/2014 05:05 PM, Peter Otten wrote: > Francis Moreau wrote: > >> Hi, >> >> In my understanding (I'm relatively new to python), I need to decode any >> bytes data provided, in my case, by a shell command (such as findmnt) >> started by the subprocess

question about the GC implementation

2009-10-02 Thread Francis Moreau
Hello, I'm looking at gcmodule.c and in move_unreachable() function, the code assumes that if an object has its gc.gc_refs stuff to 0 then it *may* be unreachable. How can an object tagged as unreachable could suddenly become reachable later ? Thanks -- http://mail.python.org/mailman/listinfo/p

Re: question about the GC implementation

2009-10-05 Thread Francis Moreau
On Oct 3, 11:58 pm, ryles wrote: > >     Only objects with GC_TENTATIVELY_UNREACHABLE still set are > candidates for collection.  If it's decided not to collect such an object > (e.g., it has a __del__ method), its gc_refs is restored to GC_REACHABLE > again. Ok so it happens _only_ w