Mageia Bugzilla – Attachment 10897 Details for
Bug 23242
python-yaml new security issue CVE-2017-18342
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
Loading and printing an instance of a class converted to YAML format
tutorial3.py (text/plain), 438 bytes, created by
Len Lawrence
on 2019-04-01 19:51:55 CEST
(
hide
)
Description:
Loading and printing an instance of a class converted to YAML format
Filename:
MIME Type:
Creator:
Len Lawrence
Created:
2019-04-01 19:51:55 CEST
Size:
438 bytes
patch
obsolete
>import yaml > >class Hero: > def __init__( self, name, hp, sp ): > self.name = name > self.hp = hp > self.sp = sp > def __repr__( self ): > return "%s(name=%r, hp=%r, sp=%r)" % ( > self.__class__.__name__, self.name, self.hp, self.sp ) > >objecttest = yaml.load( """ > !!python/object:__main__.Hero > name: Welthyr Syxgon > hp: 1200 > sp: 0 > """, Loader=yaml.FullLoader ) > >print( objecttest )
import yaml class Hero: def __init__( self, name, hp, sp ): self.name = name self.hp = hp self.sp = sp def __repr__( self ): return "%s(name=%r, hp=%r, sp=%r)" % ( self.__class__.__name__, self.name, self.hp, self.sp ) objecttest = yaml.load( """ !!python/object:__main__.Hero name: Welthyr Syxgon hp: 1200 sp: 0 """, Loader=yaml.FullLoader ) print( objecttest )
View Attachment As Raw
Actions:
View
Attachments on
bug 23242
: 10897 |
10898