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

Fixed issue where the code assumes ~/.FeelUOwn/ exists when copying png files #719

Merged
merged 1 commit into from
Jul 18, 2023

Conversation

Torxed
Copy link
Contributor

@Torxed Torxed commented Jul 18, 2023

When on a fresh install as a system library (usually via OS packaging), the following will happen:

anton@hotlap ~ $ feeluown genicon
Generate icon, then you can see app on desktop.
Traceback (most recent call last):
  File "/usr/bin/feeluown", line 33, in <module>
    sys.exit(load_entry_point('feeluown==3.8.12', 'console_scripts', 'feeluown')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/feeluown/entry_points/run.py", line 27, in run
    return run_cli(args)
           ^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/feeluown/entry_points/run_cli.py", line 6, in run_cli
    aio.run(climain(args))
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/feeluown/cli/cli.py", line 221, in climain
    generate_icon()
  File "/usr/lib/python3.11/site-packages/feeluown/cli/install.py", line 126, in generate_icon
    gen_for_win_linux()
  File "/usr/lib/python3.11/site-packages/feeluown/cli/install.py", line 78, in gen_for_win_linux
    shutil.copy(from_icon, to_icon)
  File "/usr/lib/python3.11/shutil.py", line 419, in copy
    copyfile(src, dst, follow_symlinks=follow_symlinks)
  File "/usr/lib/python3.11/shutil.py", line 258, in copyfile
    with open(dst, 'wb') as fdst:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/anton/.FeelUOwn/feeluown.png'

The code assumes ~/.FeelUOwn/ exists, which is not true on a fresh machine with a fresh install of feeluown.

This PR should correct this.

Copy link
Member

@cosven cosven left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coveralls
Copy link

Pull Request Test Coverage Report for Build 5586340058

  • 0 of 1 (0.0%) changed or added relevant line in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage decreased (-0.004%) to 59.593%

Changes Missing Coverage Covered Lines Changed/Added Lines %
feeluown/cli/install.py 0 1 0.0%
Files with Coverage Reduction New Missed Lines %
feeluown/cli/install.py 1 22.39%
Totals Coverage Status
Change from base Build 5578444668: -0.004%
Covered Lines: 8601
Relevant Lines: 14433

💛 - Coveralls

@cosven cosven merged commit 482a155 into feeluown:master Jul 18, 2023
9 checks passed
@Torxed Torxed deleted the fix-dir-assumption branch July 18, 2023 12:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants