Ticket #25 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

Constructor and representer for datetimes with timezone do not match

Reported by: lele@… Owned by: xi
Priority: normal Component: pyyaml
Severity: normal Keywords:
Cc:

Description

I noticed what seems a little glitch in PyYAML handling of datetime when they carry a timezone.

The regexp used to match the various fields assumes there is a separator between the fractional part and the timezone offset, while the representer simply appends the offset without any separator, effectively resulting in a wrong representation (in the case the offset is positive).

Moreover, unicode(data.utcoffset()) gives something like "-1 day, 22:00" for an offset of -2 hours.

Attachments

Change History

Changed 5 years ago by xi

  • status changed from new to closed
  • resolution set to fixed

Fixed in [225], although I'm not entirely happy with throwing away tzinfo.

It's possible to pickle the tzinfo attribute, but this will break compatibility with the !!timestamp` spec:  http://yaml.org/type/timestamp.html

Add/Change #25 (Constructor and representer for datetimes with timezone do not match)

Author


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


Change Properties
<Author field>
Action
as closed
The resolution will be deleted. Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.