Re: ntvdm problem on win2k

2005-04-09 Thread Alexander Schremmer
On Sat, 09 Apr 2005 11:00:08 -0700, Al Christians wrote:

> I started having some problems running python programs (python 2.3) from 
> the Win2k command line.  I would get crashes with an NTVDM error. 

Windows tries to execute the cygwin symbolic link and fails.
Correcting your path works (as you said).

Kind regards,
Alexander
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: unicode encoding usablilty problem

2005-02-19 Thread Alexander Schremmer
On Fri, 18 Feb 2005 21:43:52 +0100, Thomas Heller wrote:

>> Eventually, the primary string type should be the Unicode
>> string. If you are curious how far we are still off that goal,
>> just try running your program with the -U option.
> 
> Not very far - can't even call functions ;-)
> 
 def f(**kw):
> ...   pass
> ...
 f(**{"a": 0})
> Traceback (most recent call last):
>   File "", line 1, in ?
> TypeError: f() keywords must be strings

That is possible:
>>> f(**{chr(ord("a")): 0})
>>>

WFM. SCNR,
Alexander
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: limited python virtual machine (WAS: Another scripting language implemented into Python itself?)

2005-01-26 Thread Alexander Schremmer
On Tue, 25 Jan 2005 22:08:01 +0100, I wrote:

 sys.safecall(func, maxcycles=1000)
> could enter the safe mode and call the func.

This might be even enhanced like this:

>>> import sys
>>> sys.safecall(func, maxcycles=1000,
 allowed_domains=['file-IO', 'net-IO', 'devices', 'gui'],
 allowed_modules=['_sre'])

Every access to objects that are not in the specified domains are
restricted by the interpreter. Additionally, external modules (which are
expected to be not "decorated" by those security checks) have to be in the
modules whitelist to work flawlessy (i.e. not generate exceptions).

Any comments about this from someone who already hacked CPython?

Kind regards,
Alexander
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: limited python virtual machine (WAS: Another scripting language implemented into Python itself?)

2005-01-25 Thread Alexander Schremmer
On Tue, 25 Jan 2005 12:22:13 -0700, Steven Bethard wrote:

>  >>This is a serious issue.
>  >>
>  >>It's also one that brings Tcl, mentioned several
>  >>times in this thread, back into focus.  Tcl presents
>  >>the notion of "safe interpreter", that is, a sub-
>  >>ordinate virtual machine which can interpret only
>  >>specific commands.  It's a thrillingly powerful and
>  >>correct solution to the main problem Jeff and others
>  >>have described.
>  >
>  > A better (and of course *vastly* more powerful but unfortunately only
>  > a dream ;-) is a similarly limited python virutal machine.
> 
> Yeah, I think there are a lot of people out there who would like 
> something like this, but it's not quite clear how to go about it.  If 
> you search Google Groups, there are a lot of examples of how you can use 
> Python's object introspection to retrieve "unsafe" functions.

IMHO a safe Python would consist of a special mode that disallows all
systemcalls that could spy/harm data (IO etc.) and imports of
non-whitelisted modules. Additionally, a loop counter in the interpreter
loop would ensure that the code does not stall the process/machine.

>>> sys.safecall(func, maxcycles=1000)
could enter the safe mode and call the func.

I am not sure how big the patch would be, it is mainly a C macro at the
begginning of every relevant function that checks the current "mode" and
raises an exception if it is not correct. The import handler would need to
check if the module is whitelisted (based on the path etc.).

Python is too dynamic to get this working while just using tricks that
manipulate some builtins/globals etc.

Kind regards,
Alexander
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: MoinMoin and Mediawiki?

2005-01-12 Thread Alexander Schremmer
On 11 Jan 2005 21:24:51 -0800, Paul Rubin wrote:

[backlinks]
>> Searching instead of indexing makes it very resilient :-)
> 
> How does it do that?  It has to scan every page in the entire wiki?!
> That's totally impractical for a large wiki.

So you want to say that c2 is not a large wiki? :-)

Kind regards,
Alexander
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: MoinMoin and Mediawiki?

2005-01-11 Thread Alexander Schremmer
On 11 Jan 2005 08:49:52 -0800, Paul Rubin wrote:

> Alexander Schremmer <[EMAIL PROTECTED]> writes:
>>> I need to set up a wiki for a small group.  I've played with MoinMoin
>>> a little bit and it's reasonably straightforward to set up, but
>>> limited in capabilities and uses BogusMarkupConventions.
>> 
>> At which point do you see limitations?
> 
> It doesn't have features that MW has, like user pages,

It does.
> lists of incoming links to wiki pages,

It does.

> automatic discussion links for every wiki page, 

Can be easily obtained manually. Just include another page where discussion
is going on. You can even protect it with different ACL config etc.

> automatic update notification for specific pages of your
> choice, 

It does.

> support for managing image uploads and embedding them
> into wiki pages, 

It does.

> 
>> And what of the markup don't you like?
> 
> The BogusMixedCaseLinkNames.  I'd rather have ordinary words with
> spaces between them, like we use in ordinary writing.

Of course it does. It does not even require [[ but [" at the beginning of
the link which might be more intuitive to the writer.

>>> In the larger world, though, there's currently One True wiki package,
>>> namely Mediawiki (used by Wikipedia).
>> 
>> It is just very famous because of Wikipedia IMHO.
> 
> Well, it's gotten a lot more development attention because of that
> same Wikipedia.

Yeah, but you know: Too many cooks spoil the broth.

>> Having a DBMS backend is good in your opinion?

> I didn't say that it was good, in fact I was listing it as a
> disadvantage there.  I think for a small wiki like I was discussing,
> it's just an extra administrative hassle.  For a large wiki though,
> MoinMoin's approach is completely unworkable and MoinMoin's
> documentation actually says so.  First of all MoinMoin uses a separate
> subdirectory for every page, and all those subdirs are in a flat top
> level directory, so if you have 100,000 wiki pages, the top level
> directory has that many subdirs.  Most file systems are not built to
> handle such large directories with any reasonable speed.

But many other are.

>  (Also, every revision has its own file in the subdir.  Lots of Wikipedia 
> pages have
> thousands of revisions).  

Yeah, same point. But if you have a working btree+ etc. implementation in
your FS, then it should not a problem. Personally, I just see another
problem at this point: paths might get very long if your page names are
long. This might result in problems on Windows. But you have to use very
long page names to hit the 256 char limit.

> The DBMS can also handle stuff like replication automatically.

But this is non-trivial.

>>> The other one will be public and is planned grow to medium size (a few
>>> thousand active users)
>>
>> There are even MoinMoin sites that are as big as that. Maybe you should
>> rethink your kind of prejudice and re-evaluate MoinMoin.
> 
> I don't doubt there are MoinMoin sites that size, but with that large
> a user base, I want something nicer looking than those
> StupidMixedCasePageNames.

See above. Just because most people still work with CamelCase, they are not
the only solution. ["Stupid mixed case page names"] is a completly valid
link in MoinMoin and has been one for years.

Kind regards,
Alexander
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: OT: MoinMoin and Mediawiki?

2005-01-11 Thread Alexander Schremmer
On 10 Jan 2005 18:45:16 -0800, Paul Rubin wrote:

> I need to set up a wiki for a small group.  I've played with MoinMoin
> a little bit and it's reasonably straightforward to set up, but
> limited in capabilities and uses BogusMarkupConventions.

At which point do you see limitations?
And what of the markup don't you like?

> In the larger world, though, there's currently One True wiki package,
> namely Mediawiki (used by Wikipedia).

It is just very famous because of Wikipedia IMHO.

>  Mediawiki is written in PHP and
> is far more complex than MoinMoin, plus it's database backed, meaning
> you have to run an SQL server as well as the wiki software itself
> (MoinMoin just uses the file system).

Having a DBMS backend is good in your opinion? It has some severe
disadvantages like not easy to scale (you would need to setup DBMS
replication), two potential points of failure, more complex setup, bigger
memory requirements, etc.

>  Plus, I'll guess that it really
> needs mod_php, while MoinMoin runs tolerably as a set of cgi's, at
> least when traffic is low.

Both should run fine in CGI mode I guess.

> What I'm getting at is I might like to install MoinMoin now and
> migrate to Mediawiki sometime later.  Anyone have any thoughts about
> whether that's a crazy plan?

If you really want to use the wiki for content, you have to agree on a
markup style. You could use an independent one (like RestructuredText) and
hope that MediaWiki supports it (MoinMoin does). Or you end up writing
complex migration scripts just for the markup.

Finding some script which just imports the data files into the DB should be
rather easy.

>  Should I just bite the bullet and run Mediawiki from the beginning?

IMHO you should not bite it but choose MoinMoin. :-)

> Is anyone here actually running Mediawiki who can say just how
> big a hassle it is?

A few months I tried to install it. I got it running. But I did not like
the necessary complex administration tasks.

> The other one will be public and is planned grow to medium size (a few
> thousand active users), but which I don't need immediately.  I
> definitely want the second one to eventually run Mediawiki.  I can
> probably keep the first one on MoinMoin indefinitely, but that would
> mean I'm eventually running two separate wiki packages, which gets
> confusing.

There are even MoinMoin sites that are as big as that. Maybe you should
rethink your kind of prejudice and re-evaluate MoinMoin.

Kind regards,
Alexander
-- 
http://mail.python.org/mailman/listinfo/python-list