o
    i                     @   s:   d Z ddlZddlZG dd dZdZdd Zdd	 ZdS )
z*
Python2/Python3 compatibility utilities.
    Nc                   @   s    e Zd ZdZdd Zdd ZdS )
utf8readerz<Takes a utf8-encoded string reader and reads bytes out of itc                 C   s
   || _ d S N)
str_reader)selfr    r   I/home/ubuntu/veenaModal/venv/lib/python3.10/site-packages/ijson/compat.py__init__   s   
zutf8reader.__init__c                 C   s   | j |dS )Nzutf-8)r   readencode)r   nr   r   r   r	      s   zutf8reader.readN)__name__
__module____qualname____doc__r   r	   r   r   r   r   r   	   s    r   aX  
ijson works by reading bytes, but a string reader has been given instead. This
probably, but not necessarily, means a file-like object has been opened in text
mode ('t') rather than binary mode ('b').

An automatic conversion is being performed on the fly to continue, but on the
other hand this creates unnecessary encoding/decoding operations that decrease
the efficiency of the system. In the future this automatic conversion will be
removed, and users will receive errors instead of this warning. To avoid this
problem make sure file-like objects are opened in binary mode instead of text
mode.
c                 C   s   t tt | S r   )warningswarn_str_vs_bytes_warningDeprecationWarning)or   r   r   _warn_and_return   s   r   c                 C   s"   t | dtkr| S tt| S )z+Returns a file-like object that reads bytesr   )typer	   bytesr   r   )fr   r   r   bytes_reader#   s   r   )r   sysr   r   r   r   r   r   r   r   r   <module>   s    	