-
Notifications
You must be signed in to change notification settings - Fork 118
Open
Description
I have issues when entering some characters e.g. into in Input. These characters are not only german umlaute like "ä, ü, ö" but also shift, arrow-up and some more. The error is:
Input two letters: Traceback (most recent call last):
File "test.py", line 9, in <module>
prompt()
File "test.py", line 6, in prompt
var_two_letters = two_letters.launch()
File "/home/administrator/.local/lib/python3.6/site-packages/bullet/client.py", line 444, in launch
if self.valid(result):
File "/home/administrator/.local/lib/python3.6/site-packages/bullet/client.py", line 417, in valid
if not bool(re.match(self.pattern, ans)):
File "/usr/lib/python3.6/re.py", line 172, in match
return _compile(pattern, flags).match(string)
TypeError: expected string or bytes-like objectMinimal code to reproduce ist:
from bullet import Input
two_letters = Input(prompt = "Input two letters: ", pattern="^[A-Z]{2}$")
def prompt():
var_two_letters = two_letters.launch()
print(var_two_letters)
prompt()
Actually, I dont even want to enter such characters, as you can see that the regex in the pattern only accepts plain characters. However, the script crashes when I just type in the character, so there is no way for me to sanitize the input before the crash.
Is there anything I can do about this? I tried the native "input" function of pything and here I can add Umlaute.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels