<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
I think my code doesn't even get through the following snippet :</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div id="appendonsend"></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
data_pd = pd.read_csv(input_file)
<div>cols = [col_0, col_1, col_2]<br>
</div>
<div><br>
</div>
<div>res_pd = data_pd</div>
<span>res_pd = res_pd.drop(cols, axis=1)</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span>I'd like to know how to close the parser (or what it means) as well.</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Bravo !</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hao Wang</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> pypy-dev <pypy-dev-bounces+haow85=live.com@python.org> on behalf of Matti Picus <matti.picus@gmail.com><br>
<b>Sent:</b> Monday, November 29, 2021 1:04 AM<br>
<b>To:</b> pypy-dev@python.org <pypy-dev@python.org><br>
<b>Subject:</b> Re: [pypy-dev] How to fix pypy3 runtime error ?</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt">
<div class="PlainText"><br>
On 29/11/21 7:38 am, Hao Wang wrote:<br>
> Dear devs:<br>
><br>
> I encountered the following error but didn't know how to fix it. <br>
> Please help.<br>
><br>
> cpyext, the emulation layer, detected that while it is calling<br>
> an object's tp_dealloc, the C code calls back a function that<br>
> tries to recreate the PyPy version of the object.  Usually it<br>
> means that tp_dealloc calls some general PyXxx() API.  It is<br>
> a dangerous and potentially buggy thing to do: even in CPython<br>
> the PyXxx() function could, in theory, cause a reference to the<br>
> object to be taken and stored somewhere, for an amount of time<br>
> exceeding tp_dealloc itself.  Afterwards, the object will be<br>
> freed, making that reference point to garbage.<br>
> >>> PyPy could contain some workaround to still work if<br>
> you are lucky, but it is not done so far; better fix the bug in<br>
> the CPython extension.<br>
> >>> This object is of type 'pandas._libs.parsers.TextReader'<br>
> Aborted<br>
><br>
> Bravo !<br>
> Hao Wang<br>
<br>
<br>
You don't show any code so it is difficult to guess what is going on. In <br>
general, PyPy is more sensitive to closing resources after use rather <br>
than depending on the garbage collector to release them when an object <br>
is collected. You could try closing the parser before it goes out of scope.<br>
<br>
<br>
Matti<br>
<br>
_______________________________________________<br>
pypy-dev mailing list<br>
pypy-dev@python.org<br>
<a href="https://mail.python.org/mailman/listinfo/pypy-dev">https://mail.python.org/mailman/listinfo/pypy-dev</a><br>
</div>
</span></font></div>
</body>
</html>