When you execute briefcase new and set the name to / you get an IndexError: string index out of range.
This is also true for some other characters such as /, \ , ", ', and ,
It appears to effect all of that class of characters due to the way the class name is created.
The problem appears to be in config.py make_class_name:
# Normalize to NFKC form, then remove any character that isn't
# in the allowed categories, or is the underscore character;
# Capitalize the resulting word.
class_name = "".join(
ch
for ch in unicodedata.normalize("NFKC", formal_name)
if unicodedata.category(ch) in xid_continue or ch in {"_"}
)
This causes the name to be stripped of all characters, making the string length zero.
This causes an attempt to make a class name to fail
# If the first character isn't in the 'start' character set,
# and it isn't already an underscore, prepend an underscore.
if unicodedata.category(class_name[0]) not in xid_start and class_name[0] != "_":
class_name = f"_{class_name}"
return class_name
Steps to reproduce
Run briefcase new
When prompted Formal Name [Hello World]: enter \
Expected behavior
Validation should force you to create a legal name, or additionally prompt you to create proper class names.
Describe the bug
When you execute
briefcase new
and set the name to / you get an IndexError: string index out of range.This is also true for some other characters such as /, \ , ", ', and , It appears to effect all of that class of characters due to the way the class name is created.
The problem appears to be in config.py make_class_name:
This causes the name to be stripped of all characters, making the string length zero.
This causes an attempt to make a class name to fail
Steps to reproduce
briefcase new
Expected behavior
Validation should force you to create a legal name, or additionally prompt you to create proper class names.
Screenshots
No response
Environment
Logs
No response
Additional context
No response