Open b0g3r opened 7 years ago
For example: https://github.com/b0g3r/flask_i18n_tg_bot/blob/master/tg_bot/main.py if in this code replace gettext with lazy_gettext, then i get an error:
File "main.py", line 44, in handler
bot.sendMessage(id, message)
File "C:\Users\b0\venvs\sel-bot\lib\site-packages\telepot\__init__.py", line 408, in sendMessage
return self._api_request('sendMessage', _rectify(p))
File "C:\Users\b0\venvs\sel-bot\lib\site-packages\telepot\__init__.py", line 397, in _api_request
return api.request((self._token, method, params, files), **kwargs)
File "C:\Users\b0\venvs\sel-bot\lib\site-packages\telepot\api.py", line 130, in request
r = fn(*args, **kwargs) # `fn` must be thread-safe
File "C:\Users\b0\venvs\sel-bot\lib\site-packages\urllib3\request.py", line 138, in request_encode_body
body, content_type = encode_multipart_formdata(fields, boundary=multipart_boundary)
File "C:\Users\b0\venvs\sel-bot\lib\site-packages\urllib3\filepost.py", line 86, in encode_multipart_formdata
body.write(data)
I use flask-babel for message internationalization. With
gettext()
my messages localized when i'm imported mymessage.py
, and i decided uselazy_gettext()
(this function returns lazy-object, which localized when callsstr()
), but inBot.sendMessage
and other methods nowhere calledstr()
with argument. May be added to the module str-wrapping?