Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pyreverse] Setting the project name with a "/" at the end crashes pyreverse #8504

Closed
qequ opened this issue Mar 28, 2023 · 2 comments · Fixed by #8517 or #9093
Closed

[pyreverse] Setting the project name with a "/" at the end crashes pyreverse #8504

qequ opened this issue Mar 28, 2023 · 2 comments · Fixed by #8517 or #9093
Assignees
Labels
Crash 💥 A bug that makes pylint crash Needs PR This issue is accepted, sufficiently specified and now needs an implementation pyreverse Related to pyreverse component
Milestone

Comments

@qequ
Copy link
Contributor

qequ commented Mar 28, 2023

Bug description

Calling pyreverse via command line naming the project with a "/" like myproject/ crashes the program

Configuration

No response

Command used

pyreverse -o png -p packagename/ path_to_project/

Pylint output

Format png is not supported natively. Pyreverse will try to generate it using Graphviz...
parsing ...

Traceback (most recent call last):
  File "/home/alvaro/env_tt/bin/pyreverse", line 8, in <module>
    sys.exit(run_pyreverse())
  File "/home/alvaro/env_tt/lib/python3.10/site-packages/pylint/__init__.py", line 74, in run_pyreverse
    PyreverseRun(argv or sys.argv[1:])
  File "/home/alvaro/env_tt/lib/python3.10/site-packages/pylint/pyreverse/main.py", line 280, in __init__
    sys.exit(self.run(args))
  File "/home/alvaro/env_tt/lib/python3.10/site-packages/pylint/pyreverse/main.py", line 299, in run
    writer.DiagramWriter(self.config).write(diadefs)
  File "/home/alvaro/env_tt/lib/python3.10/site-packages/pylint/pyreverse/writer.py", line 53, in write
    self.save()
  File "/home/alvaro/env_tt/lib/python3.10/site-packages/pylint/pyreverse/writer.py", line 154, in save
    self.printer.generate(self.file_name)
  File "/home/alvaro/env_tt/lib/python3.10/site-packages/pylint/pyreverse/dot_printer.py", line 159, in generate
    pdot, dot_sourcepath = tempfile.mkstemp(".gv", name)
  File "/usr/lib/python3.10/tempfile.py", line 480, in mkstemp
    return _mkstemp_inner(dir, prefix, suffix, flags, output_type)
  File "/usr/lib/python3.10/tempfile.py", line 395, in _mkstemp_inner
    fd = _os.open(file, flags, 0o600)
FileNotFoundError: [Errno 2] No such file or directory: '/tmp/packages_packagename/_uqrljp5.gv'

Expected behavior

Generate images correctly

Pylint version

pylint 2.17.1
astroid 2.15.1
Python 3.10.10 (main, Feb  8 2023, 14:50:01) [GCC 9.4.0]

OS / Environment

ubuntu 22.04

Additional dependencies

No response

@qequ qequ added the Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling label Mar 28, 2023
@Pierre-Sassoulas Pierre-Sassoulas added pyreverse Related to pyreverse component Crash 💥 A bug that makes pylint crash Needs PR This issue is accepted, sufficiently specified and now needs an implementation and removed Needs triage 📥 Just created, needs acknowledgment, triage, and proper labelling labels Mar 28, 2023
@qequ
Copy link
Contributor Author

qequ commented Mar 29, 2023

@Pierre-Sassoulas please assign this to me

@Pierre-Sassoulas
Copy link
Member

Done, thank you for working on pyreverse :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Crash 💥 A bug that makes pylint crash Needs PR This issue is accepted, sufficiently specified and now needs an implementation pyreverse Related to pyreverse component
Projects
None yet
2 participants