Your message dated Wed, 3 Nov 2021 00:16:28 -0400
with message-id 
<CAB4XWXxzr6s-Cy0hV=bpt5vqh2o545fclbhyolcbytmoxmi...@mail.gmail.com>
and subject line Re: Bug#953245: pylint: pyreverse fails when parsing 
dataclasses
has caused the Debian Bug report #953245,
regarding pylint: pyreverse fails when parsing dataclasses
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
953245: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=953245
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: pylint
Version: 2.4.4-2
Severity: normal

Dear Maintainer,

pyreverse fails to parse python code that contains dataclasses. It is simple to 
reproduce the
problem with a simple python file containing only:

from dataclasses import dataclass
@dataclass
class Data:
    a: int

running pyreverse with no option on this file leads to the following error:

parsing pyrevbug.py...
Traceback (most recent call last):
  File "/usr/bin/pyreverse", line 11, in <module>
    load_entry_point('pylint==2.4.4', 'console_scripts', 'pyreverse')()
  File "/usr/lib/python3/dist-packages/pylint/__init__.py", line 37, in 
run_pyreverse
    PyreverseRun(sys.argv[1:])
  File "/usr/lib/python3/dist-packages/pylint/pyreverse/main.py", line 184, in 
__init__
    sys.exit(self.run(args))
  File "/usr/lib/python3/dist-packages/pylint/pyreverse/main.py", line 202, in 
run
    diadefs = handler.get_diadefs(project, linker)
  File "/usr/lib/python3/dist-packages/pylint/pyreverse/diadefslib.py", line 
235, in get_diadefs
    diagrams = DefaultDiadefGenerator(linker, self).visit(project)
  File "/usr/lib/python3/dist-packages/pylint/pyreverse/utils.py", line 217, in 
visit
    self.visit(local_node)
  File "/usr/lib/python3/dist-packages/pylint/pyreverse/utils.py", line 217, in 
visit
    self.visit(local_node)
  File "/usr/lib/python3/dist-packages/pylint/pyreverse/utils.py", line 214, in 
visit
    methods[0](node)
  File "/usr/lib/python3/dist-packages/pylint/pyreverse/diadefslib.py", line 
169, in visit_classdef
    self.extract_classes(node, anc_level, association_level)
  File "/usr/lib/python3/dist-packages/pylint/pyreverse/diadefslib.py", line 
113, in extract_classes
    self.add_class(klass_node)
  File "/usr/lib/python3/dist-packages/pylint/pyreverse/diadefslib.py", line 
83, in add_class
    self.linker.visit(node)
  File "/usr/lib/python3/dist-packages/pylint/pyreverse/utils.py", line 214, in 
visit
    methods[0](node)
  File "/usr/lib/python3/dist-packages/pylint/pyreverse/inspector.py", line 
166, in visit_classdef
    self.handle_assignattr_type(assignattr, node)
  File "/usr/lib/python3/dist-packages/pylint/pyreverse/inspector.py", line 
232, in handle_assignattr_type
    current = set(parent.instance_attrs_type[node.attrname])
AttributeError: 'Unknown' object has no attribute 'attrname'


Note that pyreverse3 of the buster version of pylint3 works correctly.

Cordially,
Raphaƫl



-- System Information:
Debian Release: bullseye/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'oldstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 5.4.0-4-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8), 
LANGUAGE=fr:en_GB (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages pylint depends on:
ii  python3                 3.7.5-3
ii  python3-astroid         2.3.3-1
ii  python3-isort           4.3.4+ds1-2
ii  python3-logilab-common  1.4.3-2
ii  python3-mccabe          0.6.1-3
ii  python3-setuptools      44.0.0-1

Versions of packages pylint recommends:
ii  python3-tk  3.8.2-2

Versions of packages pylint suggests:
ii  pylint-doc  2.4.4-2

-- no debconf information

--- End Message ---
--- Begin Message ---
Version: 2.5.3-1

>  This problem, as you reported, seems to resolve since pylint 2.5.0 in
> the upstream.
> FYI: https://github.com/PyCQA/pylint/issues/3256
>
>  Moreover, Debian stable (bullseye) already has a newer version of
> pylint, more than 2.5.0 at this moment. Then I believe the maintainer
> has resolved this problem.
>
>  To confirm your problem today, I got the correct results shown below.
> (Sorry for accuracy, I use Debian sid.)
>
> --------------here-----------------
> $ lsb_release -a
> No LSB modules are available.
> Distributor ID: Debian
> Description:    Debian GNU/Linux bookworm/sid
> Release:        unstable
> Codename:       sid
> $ env LANG=C dpkg -l pylint
> Desired=Unknown/Install/Remove/Purge/Hold
> | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-
> aWait/Trig-pend
> |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
> ||/ Name           Version      Architecture Description
> +++-==============-============-============-
> ======================================================
> ii  pylint         2.7.2-3      all          Python 3 code static
> checker and UML diagram generator
> $ cat dataclass.py
> from dataclasses import dataclass
> @dataclass
> class Data:
>     a: int
> $ pyreverse dataclass
> parsing /home/nojima/prog/python-test/pylint-work/bugs/dataclass.py...
> $ ls
> classes.dot  dataclass.py
> ------------here-----------------------------

thanks for checking, closing this report then!

Cheers,
-- 
Sandro "morph" Tosi
My website: http://sandrotosi.me/
Me at Debian: http://wiki.debian.org/SandroTosi
Twitter: https://twitter.com/sandrotosi

--- End Message ---

Reply via email to