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()
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
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',
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
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
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
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__',
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
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
* 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
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
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
12 matches
Mail list logo