'pylance report GeneralTypeIssues on members while typing pycurl example

I am a python beginner learning pycurl with its example on VSCode.

import pycurl
from io import BytesIO

buffer = BytesIO()
c = pycurl.Curl()
c.setopt(c.INTERFACE, 'lo')
c.setopt(c.URL, "http://127.0.0.1")
c.setopt(c.WRITEDATA, buffer)
c.perform()
c.close()

body = buffer.getvalue()
print(body.decode('UTF-8'))

But pylance reports GeneralTypeIssues on Curl members as picture belows: GeneralTypeIssues

Cannot access member "INTERFACE" for type "Curl" Member "INTERFACE" is unknownPylancereportGeneralTypeIssues

I don't know where I can report this issue on Pylance or pycurl so I came to Stackoverflow for help.

Much thanks for your viewing in advance.



Solution 1:[1]

I think that's the problem:c.setopt(c.INTERFACE, 'lo') c.setopt(c.URL, "http://127.0.0.1") c.setopt(c.WRITEDATA, buffer) Think again about whether you can use c.INTERFACE. c is a curl while INTERFACE is a property of pycurl. You can try to change c.INTERFACE into pycurl.INTERFACE

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 MingJie-MSFT