[pkg-boost-devel] Bug#473177: libboost-date-time-dev: time_formatters.hpp incorrectly formats fractional seconds using global locale

LeJacq, Jean Pierre jp.lejacq at quoininc.com
Fri Mar 28 23:38:05 UTC 2008

Package: libboost-date-time-dev
Version: 1.34.1-9
Severity: important
Tags: patch

The function boost::posix_time::to_iso_string_type() uses the
ostream::operator<<() function to write the time. This later function
will use the current global locale to format each of the elements of
the time. In particular, when the global locale is set to en_US, the
fractional will be formatted to be 123,456 when there are six digits,
which is incorrect.
The proposed solution is to temporarily imbue the ostream with the
classic locale to disable formatting. The attached patch only applies
this to the fractional seconds but it would be more robust to apply to
the other time components as well.

This defect has already been reported upstream

This defect is similar to Debian Bug#469771.

-- System Information:
Debian Release: lenny/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.24-qi.workstation (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libboost-date-time-dev depends on:
ii  libboost-date-time1.34.1      1.34.1-9   set of date-time libraries based 
ii  libboost-dev                  1.34.1-9   Boost C++ Libraries development 

libboost-date-time-dev recommends no packages.

-- no debconf information
-------------- next part --------------
A non-text attachment was scrubbed...
Name: boost_date_time_posix_time_time_formatters_hpp.patch
Type: text/x-c++
Size: 875 bytes
Desc: not available
Url : http://lists.alioth.debian.org/pipermail/pkg-boost-devel/attachments/20080328/e5908da1/attachment.bin 

More information about the pkg-boost-devel mailing list