Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

TextBox does not accept dead keys #19744

Open
Labels
@KleinJohn

Description

@KleinJohn

Bug report

Bug summary

Typing a dead key (a key which is not written directly after a keypress, e.g. ^, ´, `) into a TextBox widget raises a TypeError. This also occurs when you press CapsLock. This prevents the user from entering some characters like "^" or using CapsLock.

Edit: After about version3.4 no error is being raised. Now CapsLock works but the TextBox just ignores dead keys.

Code for reproduction

frommatplotlibimportpyplotaspltfrommatplotlib.widgetsimportTextBoxfig,ax=plt.subplots(figsize=(6,3))fig.subplots_adjust(bottom=0.2)text_box_ax=fig.add_axes([0.4,0.02,0.5,0.06])text_box=TextBox(text_box_ax,"Type diacritic character (e.g. ^): ")plt.show()

Actual outcome

Traceback (most recent call last):  File "\matplotlib\cbook\__init__.py", line 196, in process    func(*args, **kwargs)  File "\matplotlib\widgets.py", line 790, in _keypress    if len(key) == 1:TypeError: object of type 'NoneType' has no len()

Expected outcome
Normal behaviour of those characters when typing them in editors or searchbars etc.

Matplotlib version

  • Operating system: windows 10, build 19041.867
  • Matplotlib version:3.2.2
  • Matplotlib backend:TkAgg
  • Python version: 3.8
  • Jupyter version (if applicable):
  • Other libraries:

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp