Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 664508 - dev-python/protobuf-python-3.6.1 needs a patch for Python3.7
Summary: dev-python/protobuf-python-3.6.1 needs a patch for Python3.7
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Arfrever Frehtes Taifersar Arahesis
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2018-08-24 18:00 UTC by Helmut Jarausch
Modified: 2018-10-02 20:08 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for Python3.7 (protobuf-python-3.6.1-py37.patch,7.87 KB, patch)
2018-08-24 18:00 UTC, Helmut Jarausch
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Helmut Jarausch 2018-08-24 18:00:08 UTC
Created attachment 544866 [details, diff]
patch for Python3.7

Python3.7 has changed the return type of PyUnicode_AsUTF8AndSize from char* to
const char*

This requires several changes.
The attached patch makes protobuf-python-3.6.1 compile with Python3.6 as well as with Python3.7.
I haven't tested if it compiles with Python2.7
Comment 1 Virgil Dupras (RETIRED) gentoo-dev 2018-08-26 12:35:55 UTC
I see that there's already a commit upstream at https://github.com/protocolbuffers/protobuf/pull/4862 which has less changes. Is the PR upstream incomplete? Couldn't we just use upstream's patch?
Comment 2 Helmut Jarausch 2018-08-26 15:41:03 UTC
(In reply to Virgil Dupras from comment #1)
> I see that there's already a commit upstream at
> https://github.com/protocolbuffers/protobuf/pull/4862 which has less
> changes. Is the PR upstream incomplete? Couldn't we just use upstream's
> patch?

Yes, the upstream patch works as well.
I personally prefer my patch which uses less const_cast s.
Comment 3 Larry the Git Cow gentoo-dev 2018-10-02 20:08:08 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=75e0f119f85b8115b69e74a24b27b50df527f9cd

commit 75e0f119f85b8115b69e74a24b27b50df527f9cd
Author:     Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
AuthorDate: 2018-10-02 19:50:26 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2018-10-02 20:07:26 +0000

    dev-python/protobuf-python: Support Python 3.7.
    
    Closes: https://bugs.gentoo.org/664508
    
    Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org>
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 .../files/protobuf-python-3.6.1-python-3.7.patch   | 67 ++++++++++++++++++++++
 .../protobuf-python/protobuf-python-3.6.1.ebuild   |  3 +-
 2 files changed, 69 insertions(+), 1 deletion(-)