Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Support bacteria -- it's the only culture some people have!


devel / comp.lang.python / Re: C API PyObject_CallFunctionObjArgs returns incorrect result

SubjectAuthor
o Re: C API PyObject_CallFunctionObjArgs returns incorrect resultJen Kris

1
Re: C API PyObject_CallFunctionObjArgs returns incorrect result

<mailman.237.1646673203.2329.python-list@python.org>

  copy mid

https://www.novabbs.com/devel/article-flat.php?id=17427&group=comp.lang.python#17427

  copy link   Newsgroups: comp.lang.python
Path: i2pn2.org!i2pn.org!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail
From: jenk...@tutanota.com (Jen Kris)
Newsgroups: comp.lang.python
Subject: Re: C API PyObject_CallFunctionObjArgs returns incorrect result
Date: Mon, 7 Mar 2022 18:13:22 +0100 (CET)
Lines: 28
Message-ID: <mailman.237.1646673203.2329.python-list@python.org>
References: <MxWmaxK--3-2@tutanota.com>
<5ad962fc-1257-dd8d-96ab-541ae5bae2fa@mrabarnett.plus.com>
<Mx_KxMD--3-2@tutanota.com>
<CAPTjJmrcOZVwB0g+aScJ7V8svx1_iW-jeOsNUdN9LKKanGLQ+A@mail.gmail.com>
<Mx_Mknz--3-2@tutanota.com>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
X-Trace: news.uni-berlin.de uqHuIhubuRL2dgofxJMzcQ+PJvwOWrU5n+WIgo8AGQ5A==
Return-Path: <jenkris@tutanota.com>
X-Original-To: python-list@python.org
Delivered-To: python-list@mail.python.org
Authentication-Results: mail.python.org; dkim=pass
reason="2048-bit key; unprotected key"
header.d=tutanota.com header.i=@tutanota.com header.b=RmKVTrX5;
dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status: OK 0.000
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'looks': 0.02; 'this:':
0.03; '2022': 0.05; 'mar': 0.07; 'string': 0.07; 'subject:API':
0.07; 'cc:addr:python-list': 0.09; 'list.\xc2\xa0': 0.09;
'string,': 0.09; 'subject:result': 0.09; 'url:mailman': 0.15;
'that.': 0.15; '09:09': 0.16; '2022,': 0.16; 'cc:name:python
list': 0.16; 'chrisa': 0.16; 'pyobject*': 0.16;
'subject:incorrect': 0.16; 'subject:returns': 0.16; 'wrote:':
0.16; 'api': 0.17; 'tue,': 0.19; 'cc:addr:python.org': 0.20;
'received:de': 0.23; 'url-ip:188.166.95.178/32': 0.25; 'url-
ip:188.166.95/24': 0.25; 'url:listinfo': 0.25; 'cc:2**0': 0.25;
'url-ip:188.166/16': 0.25; 'library': 0.26; 'email
addr:python.org&gt;': 0.28; 'url-ip:188/8': 0.31; 'python-list':
0.32; 'received:192.168.1': 0.32; 'but': 0.32; 'header:In-Reply-
To:1': 0.34; 'received:192.168': 0.37; 'list': 0.39; 'email
name:&lt;python-list': 0.84
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1646673202;
s=s1; d=tutanota.com;
h=From:From:To:To:Subject:Subject:Content-Description:Content-ID:Content-Type:Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:In-Reply-To:In-Reply-To:MIME-Version:MIME-Version:Message-ID:Message-ID:Reply-To:References:References:Sender;
bh=vrpWHr7UC3JuDY+LUCB0xGgoK7JuEc/g+jU1lXAfBVg=;
b=RmKVTrX5kujb+lia6Qzcf47K/K8uMs3H2PEShL7shigEz70gslh9aAwLiJYTxPkJ
Cq8nMApVYV3FBTRViULxDNZ5nl7RMr0r+4Is9fpbO22L/pouajSBrjhjWIMzgcGuQhA
xidMONKFdOlB2CQL4Dk9zfce5Fc+XVQAwbmYL1HsBVYot8sXLbiAbX/tlFkvtGUbrGv
EodCp3nvb2FY+eEFkhuojwaRuzxWQbb1EgiuYu2Qy9XF3aCC2Lmx4p5MfyHzx7xYhee
8W0OFy/+ulOuLJu70yU9+Pix1reAffsDPYPy+PJEJkS2m5wT5/Z3p93wQ/ebch8/zxy
PhrmIyiqiA==
In-Reply-To: <CAPTjJmrcOZVwB0g+aScJ7V8svx1_iW-jeOsNUdN9LKKanGLQ+A@mail.gmail.com>
X-Content-Filtered-By: Mailman/MimeDel 2.1.39
X-BeenThere: python-list@python.org
X-Mailman-Version: 2.1.39
Precedence: list
List-Id: General discussion list for the Python programming language
<python-list.python.org>
List-Unsubscribe: <https://mail.python.org/mailman/options/python-list>,
<mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive: <https://mail.python.org/pipermail/python-list/>
List-Post: <mailto:python-list@python.org>
List-Help: <mailto:python-list-request@python.org?subject=help>
List-Subscribe: <https://mail.python.org/mailman/listinfo/python-list>,
<mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID: <Mx_Mknz--3-2@tutanota.com>
X-Mailman-Original-References: <MxWmaxK--3-2@tutanota.com>
<5ad962fc-1257-dd8d-96ab-541ae5bae2fa@mrabarnett.plus.com>
<Mx_KxMD--3-2@tutanota.com>
<CAPTjJmrcOZVwB0g+aScJ7V8svx1_iW-jeOsNUdN9LKKanGLQ+A@mail.gmail.com>
 by: Jen Kris - Mon, 7 Mar 2022 17:13 UTC

The PyObject str_sentence is a string representation of a list.  I need to convert the list to a string like "".join because that's what the library call takes. 

Mar 7, 2022, 09:09 by rosuav@gmail.com:

> On Tue, 8 Mar 2022 at 04:06, Jen Kris via Python-list
> <python-list@python.org> wrote:
>
>> But with the C API it looks like this:
>>
>> PyObject *pSentence = PySequence_GetItem(pSents, sent_count);
>> PyObject* str_sentence = PyObject_Str(pSentence); // Convert to string
>>
>> PyObject* repr_str = PyObject_Repr(str_sentence);
>>
>
> You convert it to a string, then take the representation of that. Is
> that what you intended?
>
> ChrisA
> --
> https://mail.python.org/mailman/listinfo/python-list
>

1
server_pubkey.txt

rocksolid light 0.9.8
clearnet tor