Opened 9 years ago

#9190 new Bugs

boost::filesystem::extension(...) throws runtime_error if the locale is unknown.

Reported by: mkm@… Owned by: Beman Dawes
Milestone: To Be Determined Component: filesystem
Version: Boost 1.54.0 Severity: Problem
Keywords: Cc:

Description

Running the following program gives an std::runtime_error if the locale is set to something which the system doesn't support.

#include <boost/filesystem.hpp>
int main() { boost::filesystem::extension("test.txt"); }
> LC_CTYPE=unknown ./a.out
> terminate called after throwing an instance of 'std::runtime_error'
>   what():  locale::facet::_S_create_c_locale name not valid
> Aborted

This is reproducible on debian testing and ubuntu 12.04 but I think it's a general issue.

  1. Is it the right behavior to throw an exception?
  1. If it should throw an exception, it should have been of type filesystem_error.

Change History (0)

Note: See TracTickets for help on using tickets.