Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Zomatree
    @Zomatree
    ill have a dig around
    Noa
    @coolreader18
    oh also @Zomatree I have a bunch of fixes for coroutines in coolreader18/fix-vm-exc-stack, so you might want to get a second branch and merge both those in
    git checkout master && git checkout -b aiohttp-merge && git merge misc-aiohttp coolreader18/fix-vm-exc-stack
    Zomatree
    @Zomatree
    seems like the signal lib is missing a bunch of attrs
    Zomatree
    @Zomatree
    are you not publically showing NSIG inside the signal lib, you use inside the source code
    ill just hardcode it as 64 for now but it should be accessable under the signal lib
    Zomatree
    @Zomatree
    @coolreader18 i think you broke the ThreadPoolExecutor, your __getattr__ stops it from working
    Noa
    @coolreader18
    yeah, that requires ModuleType.getattribute to respect the module's defined getattr
    i cherrypicked 1f35a09 in and removed everything but the changes to module.rs
    lotta stuff happening :sweat_smile:
    Zomatree
    @Zomatree
    yeah everything is all over the place
    Noa
    @coolreader18
    @Zomatree I pushed to misc-aiohttp again, it should get farther along and properly error in aiohttp now
    Zomatree
    @Zomatree
    im getting cert errors now even though i enabled the ssl feature
    Noa
    @coolreader18
    @Zomatree basic aiohttp functionality works now! just on the misc-aiohttp branch with cargo build --release --features ssl:
    import idna_ssl; import sys; sys.version_info = (3, 6, 0)
    import aiohttp
    import asyncio
    
    async def main():
        async with aiohttp.ClientSession() as session:
            async with session.get('http://python.org') as response:
                print(await response.text())
    
    asyncio.run(main())
    ❯ rustpython t.py
    <!doctype html>
    <!--[if lt IE 7]>   <html class="no-js ie6 lt-ie7 lt-ie8 lt-ie9">   <![endif]-->
    <!--[if IE 7]>      <html class="no-js ie7 lt-ie8 lt-ie9">          <![endif]-->
    <!--[if IE 8]>      <html class="no-js ie8 lt-ie9">                 <![endif]-->
    <!--[if gt IE 8]><!--><html class="no-js" lang="en" dir="ltr">  <!--<![endif]-->
    
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- snip -->
    </body>
    </html>
    the version_info hack is required because we don't have PEP 560 implemented, but I don't think that should be too hard
    Zomatree
    @Zomatree
    error[E0425]: cannot find function, tuple struct or tuple variant `SSL_get_current_compression` in module `sys`
       --> vm/src/stdlib/ssl.rs:702:41
        |
    702 |         let comp_method = unsafe { sys::SSL_get_current_compression(stream.ssl().as_ptr()) };
    seems like openssl-sys is giving me issues
    Noa
    @coolreader18
    Oh, I guess that's an old ssl version. I think it's possible to shim that functionality
    Noa
    @coolreader18
    @Zomatree could you try again? I just pushed to misc-aiohttp
    Zomatree
    @Zomatree
    its not erroring with that anymore, i have openssl 1.1.1
    SSLError: (134, 'certificate verify failed (_ssl.c:1913)') welp
    Noa
    @coolreader18
    huh.. what's the traceback of that?
    and is that with discord or just the aiohttp helloworld?
    Zomatree
    @Zomatree
    @coolreader18 both
    Noa
    @coolreader18
    hm, that's really weird, it's not like there's any ssl configuration
    oh wait i do use the system ssl lib, let me try with vendoring it into the binary
    ah I'm able to reproduce it now!
    Noa
    @coolreader18
    although I'm not sure what we could do to fix it, it seems like it might be an issue in openssl-sys' tarball of openssl
    Try setting OPENSSL_NO_VENDOR=1 while building, that should fix the issue temporarily (assuming you have openssl installed on your system)
    Zomatree
    @Zomatree
    yeah that seems to have fixed it
    Zomatree
    @Zomatree
      File "/home/zomatree/rustpytest/discord/http.py", line 134, in ws_connect
        return await self.__session.ws_connect(url, **kwargs)
    TypeError: 'coroutine_wrapper' object is not an iterator
    a new error
    Noa
    @coolreader18
    @Zomatree just pushed a fix
    Zomatree
    @Zomatree
    zlib.Decompress.decompress should be able to take both bytes and bytearray but it errors on bytearray
    >>>>> zlib.decompressobj().decompress(bytearray())
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    TypeError: Expected type 'bytes', not 'bytearray'
    Noa
    @coolreader18
    fixed :+1:
    this is a real smoke test of the small inconsistencies we have across the codebase :smile:
    Zomatree
    @Zomatree
    https://mystb.in/AcademyLensesButler.rust well its kinda working, however...
    Noa
    @coolreader18
    Hm, that's weird, I thought the json implementation handled unicode
    Noa
    @coolreader18
    @Zomatree Would you be able to find the specific string that had that unicode in it? I'd like to make sure my fix works
    ah nvm, I got it
    Zomatree
    @Zomatree

    rustpython doesnt add member descriptors for attributes defined inside __slots__.

    >>>>> class A:
    .....   __slots__ = ("b",)
    .....
    >>>>> dict(A.__dict__)
    {'__dict__': <getset_descriptor object at 0x55ba83927880>, '__doc__': None, '__new__': <bound method of <class '__main__.A'>>, '__module__': '__main__', '__qualname__': 'A', '__slots__': ('b',)}
    >>>>> A.b
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    AttributeError: type object 'A' has no attribute 'b'
    >>> class A:
    ...     __slots__ = ("b",)
    
    >>> A.__dict__
    mappingproxy({'__module__': '__main__', '__slots__': ('b',), 'b': <member 'b' of 'A' objects>, '__doc__': None})
    
    >>> A.b
    <member 'b' of 'A' objects>

    (also slight nitpick, mappingproxy has a differant repr)

    Noa
    @coolreader18
    yeah, we don't really support __slots__ at the moment
    Jeong YunWon
    @youknowone
    time for slot_descriptor
    Noa
    @coolreader18
    yeah, wooo 🙃
    I think CPython makes the object repr dependent on the __slots__, I assume we would just have a SlottedObjectpayload type with a vec field instead?
    Jeong YunWon
    @youknowone
    that make sense. but i don’t know how cpython handle it
    that sounds like to bea perfect solution if multiple inheritance is not possible with slot parent and other payload-attached types
    Zomatree
    @Zomatree
    do you have an example of using the _json module, i cant seem to get it to work
    Zomatree
    @Zomatree
    nvm got it
    Jonathan
    @jboi:jboi.nl
    [m]
    "lobby" implies there are more rooms, are there more rooms?