I have a string "[u'foo']" (Yes, it includes the square brackets and the u''). I have to convert that to a list which looks like [u'foo'].
list("[u'foo']") won't work.
Any suggestions?
I have a string "[u'foo']" (Yes, it includes the square brackets and the u''). I have to convert that to a list which looks like [u'foo'].
list("[u'foo']") won't work.
Any suggestions?
eval("[u'foo']", {'__builtins__':[]}, {})
locals and globals isn't enough to 'secure' eval, yes? This still gives an attacker basically full access to your system.eval('__import__("os").getcwd()', {}, {}), I edited my answereval("[x for x in type(type(1)).__bases__[0].__subclasses__() if x.__name__ == 'file'][0]('/etc/passwd').readline()", {}, {}) gives me the first line of /etc/passwd on my system.