Bug#969209: reportbug: rejects Unicode in "email" setting
Package: reportbug
Version: 7.7.0
Severity: normal
Hi,
I tried setting
+---
| email "😸@43-1.org"
+---[ ~/.reportbugrc ]
but reportbug then failed:
+---
| % reportbug reportbug
| *** Welcome to reportbug. Use ? for help at prompts. ***
| Note: bug reports are publicly archived (including the email address of the submitter).
| Detected character set: UTF-8
| Please change your locale if this is incorrect.
|
| Traceback (most recent call last):
| File "/usr/bin/reportbug", line 2302, in <module>
| main()
| File "/usr/bin/reportbug", line 1107, in main
| return iface.user_interface()
| File "/usr/bin/reportbug", line 1328, in user_interface
| fromaddr = utils.get_user_id(self.options.email, self.options.realname, charset)
| File "/usr/lib/python3/dist-packages/reportbug/utils.py", line 332, in get_user_id
| return email.utils.formataddr((realname, emailaddr))
| File "/usr/lib/python3.8/email/utils.py", line 91, in formataddr
| address.encode('ascii')
| UnicodeEncodeError: 'ascii' codec can't encode character '\U0001f638' in position 0: ordinal not in range(128)
+---
Unicode in local parts should be allowed though:
+---
| The preceding changes mean that the following constructs now allow
| UTF-8:
| [...]
| 2. Any construct that uses atoms, including but not limited to the
| local parts of addresses and Message-IDs. This includes
| addresses in the "for" clauses of "Received:" header fields.
+---[ https://tools.ietf.org/html/rfc6532, Section 3.2 ]
Ansgar
-- System Information:
Debian Release: bullseye/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'testing'), (500, 'stable'), (300, 'buildd-unstable'), (300, 'unstable'), (1, 'experimental-debug'), (1, 'buildd-experimental'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 5.7.0-2-amd64 (SMP w/8 CPU threads)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=C, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
Versions of packages reportbug depends on:
ii apt 2.1.10
ii python3 3.8.2-3
ii python3-reportbug 7.7.0
ii sensible-utils 0.0.12+nmu1
reportbug recommends no packages.
Versions of packages reportbug suggests:
pn claws-mail <none>
pn debconf-utils <none>
pn debsums <none>
pn dlocate <none>
ii emacs-bin-common 1:27.1+1-1
ii exim4 4.94-7
ii exim4-daemon-light [mail-transport-agent] 4.94-7
ii file 1:5.38-5
ii gnupg 2.2.20-1
pn python3-urwid <none>
pn reportbug-gtk <none>
ii xdg-utils 1.1.3-2
Versions of packages python3-reportbug depends on:
ii apt 2.1.10
ii file 1:5.38-5
ii python3 3.8.2-3
ii python3-apt 2.1.3
ii python3-debian 0.1.37
ii python3-debianbts 3.0.2
ii python3-requests 2.23.0+dfsg-2
ii sensible-utils 0.0.12+nmu1
python3-reportbug suggests no packages.
-- no debconf information
Reply to: