Modify

Ticket #216 (new defect)

Opened 18 months ago

Last modified 18 months ago

Representer error

Reported by: anonymous Owned by: xi
Priority: normal Component: pyyaml
Severity: normal Keywords:
Cc:

Description

I think that type should reverse to exception results see code:

def represent_unicode(self, data):

tag = None try:

data.encode('ascii') tag = u'tag:yaml.org,2002:python/unicode'

except UnicodeEncodeError?:

tag = u'tag:yaml.org,2002:str'

return self.represent_scalar(tag, data)

Attachments

Change History

comment:1 Changed 18 months ago by anonymous

Should be:

def represent_unicode(self, data):

tag = None try:

data.encode('ascii') tag = u'tag:yaml.org,2002:str'

except UnicodeEncodeError?:

tag = u'tag:yaml.org,2002:python/unicode'

return self.represent_scalar(tag, data

comment:2 Changed 18 months ago by anonymous

Look that is vaild since YAML str is unicode : )  http://www.yaml.org/type/

View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from xi. Next status will be 'new'
The owner will be changed from xi to anonymous. Next status will be 'assigned'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.