Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Zomatree
    @Zomatree
    im getting cert errors now even though i enabled the ssl feature
    Noah
    @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
    Noah
    @coolreader18
    Oh, I guess that's an old ssl version. I think it's possible to shim that functionality
    Noah
    @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
    Noah
    @coolreader18
    huh.. what's the traceback of that?
    and is that with discord or just the aiohttp helloworld?
    Zomatree
    @Zomatree
    @coolreader18 both
    Noah
    @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!
    Noah
    @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
    Noah
    @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'
    Noah
    @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...
    Noah
    @coolreader18
    Hm, that's weird, I thought the json implementation handled unicode
    Noah
    @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)

    Noah
    @coolreader18
    yeah, we don't really support __slots__ at the moment
    Jeong YunWon
    @youknowone
    time for slot_descriptor
    Noah
    @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?
    Jeong YunWon
    @youknowone
    no, it is lobby and plaza at the same time. we don’t have that much traffic to separate channels yet
    Jonathan
    @jboi:jboi.nl
    [m]
    ah ok
    Prefix Required Jones
    @mojosd_twitter
    A discord server would be nice.
    Prefix Required Jones
    @mojosd_twitter
    Having threads would make reading these exchanges easier I think. Also, the Dev Guide mentions that there are contributors here willing to mentor those of us who are new to the project, and in my case new to OSS. If you one of those people willing to help and mentor someone new to RustPython, please let me know. I'm hoping to get some help with how to work with this project. Thank you.
    10 replies
    Pluriscient
    @Pluriscient

    A discord server would be nice.

    Zulip is also an alternative: https://zulip.com/

    0xc
    @tcarrio:matrix.org
    [m]
    What does the performance of RustPython look like so far?
    Klas Segeljakt
    @segeljakt

    Noob question, with python3-REPL I can import numpy as np, but with rustpython-REPL I get:

    >>>>> import numpy as np
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'numpy'

    is there a way to make it work?

    Noah
    @coolreader18
    No, we don't support numpy yet
    Klas Segeljakt
    @segeljakt
    hmm, how does it work, do all libraries need to be implemented in Rust for it to work?
    fbpyr
    @fbpyr:tchncs.de
    [m]
    @segeljakt: I would assume quite a few of the pure python libs should work directly, but probably not the ones having compiled C/asm/.. parts in it - like numpy.
    Noah
    @coolreader18
    I think the current plan is to implement the hpy abi, and then eventually numpy might support that as well: https://github.com/hpyproject/HPy https://github.com/hpyproject/numpy-hpy
    Klas Segeljakt
    @segeljakt
    👍