Git Product home page Git Product logo

dicebear's Introduction

Hi there ๐Ÿ‘‹

I study Computer Science in the field of Software Development.

  • Discord: .jvh

Current project(s)

Tools and languages


https://github-readme-stats.vercel.app/api?username=jvherck&theme=nord&show_icons=true&hide=prs
Top Langs

dicebear's People

Contributors

jvherck avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

dicebear's Issues

converting to Pillow

Hi

Trying to convert avatar to Pillow object, so I can save it as a file

calling av.pillow() gives me this error

cannot identify image file <_io.BytesIO object at 0x7f8fac03ffb0>
CommandError: cannot identify image file <_io.BytesIO object at 0x7f8fac03ffb0>

Pillow installed
Python 3.11

any clues?

Dicebear only supports Python 3.10+ due to Union TypeError

Problem

So I installed the latest version of dicebear, 0.4.15 but due to this line of code on line 68 in errors.py, there will be a TypeError as I'm running Python 3.9.0,
TypeError: unsupported operand type(s) for |: 'type' and 'type'.

def log_error(exception: Exception | str): # <-- Not supported in Python 3.9 and below
    _exc = exception
    logger = logging.getLogger()
    logger.setLevel(logging.ERROR)
    handler = logging.StreamHandler()
    handler.setFormatter(logging.Formatter(f"%(levelname)s: {_exc.__module__}: %(message)s"))
    handler.setLevel(logging.ERROR)
    logger.addHandler(handler)
    logger.error(_exc)

Suggested fix

from typing import Union

def log_error(exception: Union[Exception, str]): # <-- Ensures backward compatibility for Python 3.9 and below
    _exc = exception
    logger = logging.getLogger()
    logger.setLevel(logging.ERROR)
    handler = logging.StreamHandler()
    handler.setFormatter(logging.Formatter(f"%(levelname)s: {_exc.__module__}: %(message)s"))
    handler.setLevel(logging.ERROR)
    logger.addHandler(handler)
    logger.error(_exc)

Thanks for reading!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.