Boost C++ Libraries: Ticket #10641: boost::filesystem::path::parent_path() throws run time error locale::facet::_S_create_c_locale name not valid https://svn.boost.org/trac10/ticket/10641 <p> I have the following code under ubuntu 12.04 with gcc 4.3.6 . </p> <pre class="wiki">#include &lt;iostream&gt; #include &lt;boost/filesystem/path.hpp&gt; using namespace std; namespace fs = boost::filesystem int main(int argc, char** argv) { try { fs::path my_path("test/test.txt"); cout &lt;&lt; "current path is " &lt;&lt; my_path &lt;&lt; endl; cout &lt;&lt; "parent path is " &lt;&lt; my_path.parent_path() &lt;&lt; endl; } catch(std::exception&amp; e) { cerr &lt;&lt; endl &lt;&lt; "Error during execution: " &lt;&lt; e.what() &lt;&lt; endl &lt;&lt; endl; return EXIT_FAILURE; } return EXIT_SUCCESS; } </pre><p> I was able to create a path using the string "test/test.txt" and print out the path as a string. However, when I was trying to access the parent_path() or stem() or extension() the program will fail and throw locale::facet::_S_create_c_locale name not valid error. </p> <p> output: current path is "test/test.txt" </p> <p> Error during execution: locale::facet::_S_create_c_locale name not valid </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/10641 Trac 1.4.3 anonymous Thu, 09 Oct 2014 21:27:50 GMT <link>https://svn.boost.org/trac10/ticket/10641#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/10641#comment:1</guid> <description> <p> I noticed that if I use filesystem version 2.0 in boost 1.49, there is no such issue. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Beman Dawes</dc:creator> <pubDate>Mon, 27 Oct 2014 23:46:28 GMT</pubDate> <title>status, milestone changed; resolution set https://svn.boost.org/trac10/ticket/10641#comment:2 https://svn.boost.org/trac10/ticket/10641#comment:2 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.57.0</span> </li> </ul> <p> Your test program failed as expected, although only if the LANG environmental variable was set to an invalid value. </p> <p> It was tested again, after applying the fix, and ran correctly. </p> <p> The fix has been pushed to develop, and so should be in time for the 1.57.0 release. The effect of the changes just pushed is to roll out the earlier specific fixes for a few path signatures to the general case of all path functions that perform conversions using path::codecvt() to supply the default codecvt facet. </p> <p> Thanks for the report, </p> <p> --Beman </p> <p> </p> Ticket