Subject: [Boost-bugs] [Boost C++ Libraries] #8535: problem with paths that have whitespace in boost::program_options
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2013-05-01 16:45:25
#8535: problem with paths that have whitespace in boost::program_options
------------------------------------------------+---------------------------
Reporter: bdahi@⦠| Owner: vladimir_prus
Type: Bugs | Status: new
Milestone: To Be Determined | Component: program_options
Version: Boost 1.53.0 | Severity: Problem
Keywords: path, empty space, program_options |
------------------------------------------------+---------------------------
This seems to be a known bug since at least 2008. Full description and
suggested solution is mentioned in the external link below:
[boost.2283326.n4.nabble.com/program-options-Problem-with-paths-that-have-
spaces-td2576490.html]
In short: when a boost::filesystem::path is used directly to retrieve a
path parameter, if the path has a whitespace -- regardless of whether / or
\ is used, or the whitespace is escaped, or the path is double-quoted -- a
parsing error occurs.
The current workaround is to use string and then convert that to
boost::filesystem::path using the = operator of the path class, however
this looks more of a "bug" in program_options rather than new feature in
lexical_cast module since in program_options lexical casting of string to
path is obviously failing and should not have been considered.
-- Ticket URL: <https://svn.boost.org/trac/boost/ticket/8535> Boost C++ Libraries <http://www.boost.org/> Boost provides free peer-reviewed portable C++ source libraries.
This archive was generated by hypermail 2.1.7 : 2017-02-16 18:50:13 UTC