Boost C++ Libraries: Ticket #4609: Boost.Python: Converting from bytes object to std::string https://svn.boost.org/trac10/ticket/4609 <p> I just realized that, in Boost.Python with Python 3, there is no way to accept a Python bytes object as function argument in C++ side. Since both std::string and char* are mapped to Python unicode object (which is the default str type in Python 3). This will cause trouble when porting existing code to Python 3. </p> <p> The attached patch fix this by allow both unicode string and bytes being converted to std::string. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/4609 Trac 1.4.3 Haoyu Bai Sun, 29 Aug 2010 10:11:13 GMT attachment set https://svn.boost.org/trac10/ticket/4609 https://svn.boost.org/trac10/ticket/4609 <ul> <li><strong>attachment</strong> → <span class="trac-field-new">bytes_to_string.patch</span> </li> </ul> Ticket Haoyu Bai Sun, 29 Aug 2010 10:13:40 GMT summary changed https://svn.boost.org/trac10/ticket/4609#comment:1 https://svn.boost.org/trac10/ticket/4609#comment:1 <ul> <li><strong>summary</strong> <span class="trac-field-old">Converting from bytes object to std::string</span> → <span class="trac-field-new">Boost.Python: Converting from bytes object to std::string</span> </li> </ul> Ticket anonymous Wed, 22 Dec 2010 19:38:25 GMT <link>https://svn.boost.org/trac10/ticket/4609#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:2</guid> <description> <p> any chance of this getting looked at soon? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Wed, 22 Dec 2010 20:18:38 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4609#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:3</guid> <description> <p> Not very likely by me, sorry. But if you poke the C++-sig another maintainer might take a crack at it. </p> </description> <category>Ticket</category> </item> <item> <author>blake@…</author> <pubDate>Sun, 02 Jan 2011 05:14:15 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/4609#comment:4 https://svn.boost.org/trac10/ticket/4609#comment:4 <ul> <li><strong>cc</strong> <span class="trac-author">blake@…</span> added </li> </ul> <p> great, thanks for commenting, I've mentioned this issue on sig-c++ just now: <a class="ext-link" href="http://mail.python.org/pipermail/cplusplus-sig/2011-January/015856.html"><span class="icon">​</span>http://mail.python.org/pipermail/cplusplus-sig/2011-January/015856.html</a> </p> Ticket DRayX Tue, 19 Jul 2011 14:00:11 GMT <link>https://svn.boost.org/trac10/ticket/4609#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:5</guid> <description> <p> Any chance of this being looked at? This is a very useful patch, and it is sort of a pain to have to apply it and compile boost every time I want to update. Thanks to bhy for the great patch. </p> </description> <category>Ticket</category> </item> <item> <author>Dane Springmeyer <dane@…></author> <pubDate>Wed, 20 Jul 2011 21:49:55 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4609#comment:6 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:6</guid> <description> <p> +1, my project is also blocked by this. </p> </description> <category>Ticket</category> </item> <item> <author>Dane Springmeyer <dane@…></author> <pubDate>Tue, 04 Oct 2011 16:42:42 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4609#comment:7 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:7</guid> <description> <p> any news on this? </p> </description> <category>Ticket</category> </item> <item> <author>mistersheik@…</author> <pubDate>Tue, 07 Feb 2012 02:39:19 GMT</pubDate> <title>cc changed https://svn.boost.org/trac10/ticket/4609#comment:8 https://svn.boost.org/trac10/ticket/4609#comment:8 <ul> <li><strong>cc</strong> <span class="trac-author">mistersheik@…</span> added </li> </ul> <p> I'm also interested in this review being looked at. </p> Ticket anonymous Tue, 07 Feb 2012 03:12:59 GMT <link>https://svn.boost.org/trac10/ticket/4609#comment:9 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:9</guid> <description> <p> FYI: <a class="ext-link" href="https://trac.macports.org/ticket/32671"><span class="icon">​</span>https://trac.macports.org/ticket/32671</a> </p> </description> <category>Ticket</category> </item> <item> <author>Robert Park <rbpark@…></author> <pubDate>Sat, 26 May 2012 17:22:14 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4609#comment:10 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:10</guid> <description> <p> +1, accept this patch! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Thu, 26 Jul 2012 21:29:29 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4609#comment:11 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:11</guid> <description> <p> Why has this not yet been addressed? I think that almost everybody using boost python with python 3 uses this patch, or has to deal with the bug. Any chance this patch could be accepted? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Fri, 27 Jul 2012 20:15:46 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4609#comment:12 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:12</guid> <description> <p> Same story here. Anyone on the boost team - can you at least comment on why this patch is not getting accepted? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Dave Abrahams</dc:creator> <pubDate>Fri, 27 Jul 2012 22:14:19 GMT</pubDate> <title>owner changed https://svn.boost.org/trac10/ticket/4609#comment:13 https://svn.boost.org/trac10/ticket/4609#comment:13 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Dave Abrahams</span> to <span class="trac-author">Ralf W. Grosse-Kunstleve</span> </li> </ul> <p> Speaking personally, maintenance responsibility for Boost.Python has largely passed from me to others. Unfortunately, I am not sure to whom the ticket should be reassigned. Maybe Ralf knows? </p> Ticket Ralf W. Grosse-Kunstleve Fri, 27 Jul 2012 22:45:33 GMT <link>https://svn.boost.org/trac10/ticket/4609#comment:14 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:14</guid> <description> <p> svn rev. 79774 applies this patch to the boost trunk </p> <p> if there are no problems I plan to merge to the release branch in about a week </p> </description> <category>Ticket</category> </item> <item> <dc:creator>anonymous</dc:creator> <pubDate>Sat, 28 Jul 2012 00:10:10 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4609#comment:15 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:15</guid> <description> <p> rwgk, thank you! </p> </description> <category>Ticket</category> </item> <item> <dc:creator>DRayX</dc:creator> <pubDate>Fri, 07 Dec 2012 15:47:04 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4609#comment:16 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:16</guid> <description> <p> Thanks for committing this rwgk, but this fix still hasn't showed up in either of the two releases since then. Is there any chance we can get this merged to the release branch? </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Ralf W. Grosse-Kunstleve</dc:creator> <pubDate>Fri, 14 Dec 2012 20:40:20 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/4609#comment:17 https://svn.boost.org/trac10/ticket/4609#comment:17 <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> </ul> <p> I merged the change into the release branch about six days ago. </p> Ticket anonymous Fri, 14 Dec 2012 21:52:55 GMT <link>https://svn.boost.org/trac10/ticket/4609#comment:18 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:18</guid> <description> <p> Thank you! </p> </description> <category>Ticket</category> </item> <item> <author>frolvlad@…</author> <pubDate>Fri, 24 Jul 2015 20:32:08 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/4609#comment:19 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/4609#comment:19</guid> <description> <p> Emm, I'm sorry to poke this old issue, but doesn't it solve only half of the problem? How do I <strong>return</strong> bytes string? It seems that it always returns Unicode string in Python 3... </p> </description> <category>Ticket</category> </item> </channel> </rss>