[New-bugs-announce] [issue30772] If I make an attribute "[a unicode version of B]", it gets assigned to "[ascii B]", and so on.

Nate Soares report at bugs.python.org
Mon Jun 26 14:08:51 EDT 2017


New submission from Nate Soares:

[NOTE: In this comment, I use BB to mean unicode character 0x1D539, b/c the issue tracker won't let me submit a comment with unicode characters in it.]

Directory structure:

repro/
  foo.py
  test_foo.py

Contents of foo.py:
    BB = 1
    __all__ = ['BB']

Contents of test_foo.py:
    from .foo import *

Error message:
    AttributeError: module 'repro.foo' has no attribute 'BB'

If I change foo.py to have `__all__ = ['B']` (note that 'B' is not the same as 'BB'), then everything works "fine", modulo the fact that now foo.B is a thing and foo.BB is not a thing.

[Recall that in the above, BB is a placeholder for U+1D539, which the issuetracker prevents me from writing here.]

----------
components: Unicode
messages: 296928
nosy: Nate Soares, ezio.melotti, haypo
priority: normal
severity: normal
status: open
title: If I make an attribute "[a unicode version of B]", it gets assigned to "[ascii B]", and so on.
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30772>
_______________________________________


More information about the New-bugs-announce mailing list