Issue 11877

Title
Can not use interactive Console with trytond-console on Python 3.11
Priority
feature
Status
chatting
Nosy list
ced, hodeinavarro, resteve
Assigned to
Keywords

Created on 2022-11-10.12:51:48 by hodeinavarro, last changed 2 weeks ago by hodeinavarro.

Messages

Author: [hidden] (hodeinavarro)
Date: 2022-11-15.08:56:06

I took a quick look at it yesterday out of boredom, heres what I found out:

  • It'd seem like the problem is how the history is being written / read.

Old .trytond_console_history

move = Move(1)

New .trytond_console_history

_HiStOrY_V2_
test\040=\040'Hello\040world'

The error raises when trying to read the old format, but the new format is working.

  • The Completer also doesn't work.

I won't assign the issue to myself just yet because I've not tinkered enough with these and right now I'd not know how to continue, but I thought it would be relevant to update this.

Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2022-11-10.13:21:07

Python 3.11 is not yet supported so it is a feature request.

Author: [hidden] (hodeinavarro)
Date: 2022-11-10.12:51:48

Traceback

❯ trytond-console -d tryton-env
/Users/hodeinavarro/Developer/.envs/tryton-env/lib/python3.11/site-packages/passlib/utils/__init__.py:854: DeprecationWarning: 'crypt' is deprecated and slated for removal in Python 3.13
  from crypt import crypt as _crypt
/Users/hodeinavarro/Developer/.envs/tryton-env/lib/python3.11/site-packages/zeep/utils.py:1: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
  import cgi
<frozen importlib._bootstrap>:1049: ImportWarning: PluginImportFixer.find_spec() not found; falling back to find_module()
/Users/hodeinavarro/Developer/.envs/tryton-env/lib/python3.11/site-packages/csb43/i18n/__init__.py:21: DeprecationWarning: Use setlocale(), getencoding() and getlocale() instead
  lc, encoding = locale.getdefaultlocale()
<frozen importlib._bootstrap>:1049: ImportWarning: PluginImportFixer.find_spec() not found; falling back to find_module()
Traceback (most recent call last):
  File "/Users/hodeinavarro/Developer/.envs/tryton-env/bin/trytond-console", line 7, in <module>
    exec(compile(f.read(), __file__, 'exec'))
  File "/Users/hodeinavarro/Developer/tryton/tryton-env/trytond/bin/trytond-console", line 30, in <module>
    console.run(options)
  File "/Users/hodeinavarro/Developer/tryton/tryton-env/trytond/trytond/console.py", line 55, in run
    console = Console(local, histsize=options.histsize)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/hodeinavarro/Developer/tryton/tryton-env/trytond/trytond/console.py", line 21, in __init__
    self.init_history(histfile, histsize)
  File "/Users/hodeinavarro/Developer/tryton/tryton-env/trytond/trytond/console.py", line 32, in init_history
    readline.read_history_file(histfile)
OSError: [Errno 22] Invalid argument

Versions

❯ python -V
Python 3.11.0
❯ pip -V
pip 22.3 from /Users/hodeinavarro/Developer/.envs/tryton-env/lib/python3.11/site-packages/pip (python 3.11)
❯ trytond-console --version
trytond-console 6.7.0

Using a new environment with Python 3.10 does not recreate this issue.

History
Date User Action Args
2022-11-15 08:56:06hodeinavarrosetmessages: + msg80069
2022-11-10 13:21:08cedsetmessages: + msg80004
nosy: + ced
priority: bug -> feature
status: unread -> chatting
type: crash -> feature request
2022-11-10 13:14:38restevesetnosy: + resteve
2022-11-10 12:51:48hodeinavarrocreate

Showing 10 items. Show all history (warning: this could be VERY long)