Re: codecs in a chroot / without fs access

2012-01-10 Thread K Richard Pixley
On 1/9/12 16:41 , Philipp Hagemeister wrote: I want to forbid my application to access the filesystem. The easiest way seems to be chrooting and droping privileges. However, surprisingly, python loads the codecs from the filesystem on-demand, which makes my program crash: import os os.getuid()

Re: codecs in a chroot / without fs access

2012-01-10 Thread Miki Tebeka
Another option is to copy the data to the a location under the new chroot and register a new lookup functions (http://docs.python.org/library/codecs.html#codecs.register). This way you can save some memory. -- http://mail.python.org/mailman/listinfo/python-list

Re: codecs, csv issues

2008-08-22 Thread John Machin
On Aug 22, 11:52 pm, George Sakkis <[EMAIL PROTECTED]> wrote: > I'm trying to use codecs.open() and I see two issues when I pass > encoding='utf8': > > 1) Newlines are hardcoded to LINEFEED (ascii 10) instead of the > platform-specific byte(s). > > import codecs > f = codecs.open('tmp.txt',

Re: codecs, csv issues

2008-08-22 Thread Peter Otten
George Sakkis wrote: > I'm trying to use codecs.open() and I see two issues when I pass > encoding='utf8': > > 1) Newlines are hardcoded to LINEFEED (ascii 10) instead of the > platform-specific byte(s). > > import codecs > f = codecs.open('tmp.txt', 'w', encoding='utf8') > s = u'\u0

Re: codecs / subprocess interaction: utf help requested

2007-06-10 Thread smitty1e
On Jun 10, 6:10 pm, John Machin <[EMAIL PROTECTED]> wrote: > On Jun 11, 7:17 am, smitty1e <[EMAIL PROTECTED]> wrote: > > > The first print statement does what you'd expect. > > The second print statement has rather a lot of rat in it. > > The goal here is to write a function that will return the ma

Re: codecs / subprocess interaction: utf help requested

2007-06-10 Thread John Machin
On Jun 11, 7:17 am, smitty1e <[EMAIL PROTECTED]> wrote: > The first print statement does what you'd expect. > The second print statement has rather a lot of rat in it. > The goal here is to write a function that will return the man page for > some command (mktemp used as a short example here) as te

Re: codecs - where are those on windows?

2006-11-04 Thread GHUM
Fredrik Lundh schrieb: > > If your installation directory is C:\Python25, then look in > > C:\Python25\lib\encodings > > that's only the glue code. the actual data sets are provided by a bunch > of built-in modules: > >>> import sys > >>> sys.builtin_module_names > ('__builtin__', '__main__',

Re: codecs - where are those on windows?

2006-10-30 Thread Fredrik Lundh
Paul Watson wrote: >> So, my question is: on Windows. where are those CJK codecs? Are they by >> any chance included in the 1.867.776 bytes of python24.dll ? > > If your installation directory is C:\Python25, then look in > > C:\Python25\lib\encodings that's only the glue code. the actual data

Re: codecs - where are those on windows?

2006-10-30 Thread Paul Watson
GHUM wrote: > I stumbled apon a paragraph in python-dev about "reducing the size of > Python" for an embedded device: > > """ > In my experience, the biggest gain can be obtained by dropping the > rarely-used > CJK codecs (for Asian languages). That should sum up to almost 800K > (uncompressed), I

Re: codecs

2005-11-15 Thread André Malo
* TK <[EMAIL PROTECTED]> wrote: > sys.stdout = codecs.lookup('utf-8')[-1](sys.stdout) > What does this line mean? "Wrap stdout with an UTF-8 stream writer". See the codecs module documentation for details. nd -- http://mail.python.org/mailman/listinfo/python-list

Re: Codecs

2005-07-10 Thread John Machin
Ivan Van Laningham wrote: > > It seems to me that if I want to try to read an unknown file > using an exhaustive list of possible encodings ... Supposing such a list existed: What do you mean by "unknown file"? That the encoding is unknown? Possibility 1: You are going to try to decode the fil

Re: Codecs

2005-07-10 Thread Martin v. Löwis
Ivan Van Laningham wrote: > Hi All-- > As far as I can tell, after looking only at the documentation (and not > searching peps etc.), you cannot query the codecs to give you a list of > registered codecs, or a list of possible codecs it could retrieve for > you if you knew enough to ask for them by