G+r ^ d Z ddlmZmZ ddlZddlmZmZmZm Z m
Z
d Zd
d Zd
Z
d Zd ZdS )z
raven.utils.encoding
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2012 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
)absolute_importunicode_literalsN)
integer_types text_typebinary_typestring_typesPY2c
ddl }ddl}t | t t d t
||j |j |j fz S )zDetermine if the object instance is of a protected type.
Objects of protected types are preserved as-is when passed to
force_text(strings_only=True).
r N)Decimaldatetime
isinstancer typefloatdatetime)objr r s f/builddir/build/BUILD/cloudlinux-venv-1.0.10/venv/lib/python3.11/site-packages/raven/utils/encoding.pyis_protected_typer sP NNNOOOc=DJJw8=(-,9 9 : : : utf-8Fstrictc x t | t r| S rt | r| S t | t st | d r| } nst s7t | t rt | } nEt | } n5t t | } n| } n]# t $ rP}t | t st |j d fd| D } Y d}~nd}~ww xY w| S )z
Similar to smart_text, except that lazy instances are resolved to
strings, rather than kept as lazy objects.
If strings_only is True, don't convert (some) non-string-like objects.
__unicode__ c 4 g | ]}t | S )
force_text).0argencodingerrorsstrings_onlys r