New submission from Martin Chase <outofcult...@gmail.com>:

This behavior is best described by the code below:

```
>>> meow = 1
>>> 'meow' in globals()
True
>>> µmeow = 1e-6
>>> 'µmeow' in globals()
False
>>> globals()['woof'] = 1
>>> woof
1
>>> globals()['µwoof'] = 1e-6
>>> µwoof
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'μwoof' is not defined
>>> import sys
>>> sys.getdefaultencoding()
'utf-8'
>>> [(k, bytes(k, 'utf-8')) for k in globals()]
..., ('μmeow', b'\xce\xbcmeow'), ('µwoof', b'\xc2\xb5woof')]
>>> 'µ'.encode('utf-8')
b'\xc2\xb5'
```

Testing was done on linux and windows, variously using 3.6.12, 3.7.6, 3.8.6 and 
3.9.0+.

----------
components: Unicode
messages: 383336
nosy: ezio.melotti, outofculture, vstinner
priority: normal
severity: normal
status: open
title: unicode identifiers not accessible or assignable through globals()
type: behavior
versions: Python 3.6, Python 3.7, Python 3.8, Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue42680>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to