[Python-bugs-list] [ python-Bugs-751793 ] Re module cannot be loaded in restricted mode

SourceForge.net noreply@sourceforge.net
Sat, 14 Jun 2003 07:20:55 -0700


Bugs item #751793, was opened at 2003-06-10 09:56
Message generated for change (Comment added) made by loewis
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=751793&group_id=5470

Category: Regular Expressions
Group: Python 2.2.2
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Christoph Zwerschke (cito)
Assigned to: Fredrik Lundh (effbot)
Summary: Re module cannot be loaded in restricted mode

Initial Comment:
If you try to use regular expressions in restricted mode, 
you get the error "'module' object has no 
attribute 'hexversion'". Try with:

import rexec
rexec.RExec().r_exec("import re")

Suggestion: Add 'hexversion' to allowed sys attributes 
in /usr/lib/python/rexec.py:

    ok_sys_names = 
('ps1', 'ps2', 'copyright', 'version', 'hexversion',
                    'platform', 'exit', 'maxint')


----------------------------------------------------------------------

>Comment By: Martin v. Löwis (loewis)
Date: 2003-06-14 16:20

Message:
Logged In: YES 
user_id=21627

This is fixed in Python 2.2.3 and 2.3 (except that rexec
won't work in these versions, anyway).

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=751793&group_id=5470