TagStudio icon indicating copy to clipboard operation
TagStudio copied to clipboard

Replace use of os.path with pathlib

Open Icosahunter opened this issue 1 year ago • 8 comments

Icosahunter avatar May 10 '24 01:05 Icosahunter

Tested on Linux (Solus) for basic functionality

Icosahunter avatar May 10 '24 01:05 Icosahunter

good job, this was really needed 👍

yedpodtrzitko avatar May 10 '24 02:05 yedpodtrzitko

@yedpodtrzitko Thanks for the comments, I think I've resolved most of them. I'll have to test with the changes and ruff-format it again.

Icosahunter avatar May 10 '24 04:05 Icosahunter

Fixed some issues that cropped up with the modularized GUI files.

Icosahunter avatar May 12 '24 15:05 Icosahunter

I think all the basics are working now, tested creating/opening library, adding tags/fields, and removing unlinked files (on Solus Linux)

Icosahunter avatar May 12 '24 16:05 Icosahunter

@CyanVoxel it would be nice to merge the mypy PRs sooner or later, errors like this https://github.com/TagStudioDev/TagStudio/pull/156#issuecomment-2113988948 will be caught automatically.

I'll get that going soon here

CyanVoxel avatar May 16 '24 04:05 CyanVoxel

Just a heads up, I'll be pulling #142 (a rewrite of #88) before this, which will cause some additional conflicts - I apologize in advance.

CyanVoxel avatar May 17 '24 21:05 CyanVoxel

Tested basic functionality on my Linux distro (Solus) and seems to be working. At one point I did get a segfault... but it didn't happen in later testing.

Icosahunter avatar May 23 '24 01:05 Icosahunter

Got a segmentation fault when trying to delete unlinked entries, but I couldn't reproduce the issue.

[ThumbRenderer][ERROR]: Couldn't render thumbnail for /home/icosahunter/Documents/test.txt ([Errno 2] No such file or directory: '/home/icosahunter/Documents/test.txt')
Traceback (most recent call last):
  File "/home/icosahunter/Repos/TagStudio/tagstudio/src/qt/widgets/preview_panel.py", line 530, in update_widgets
    raise UnidentifiedImageError
PIL.UnidentifiedImageError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/icosahunter/Repos/TagStudio/tagstudio/src/qt/ts_qt.py", line 1209, in <lambda>
    lambda checked=False, entry=entry: self.select_item(
                                       ^^^^^^^^^^^^^^^^^
  File "/home/icosahunter/Repos/TagStudio/tagstudio/src/qt/ts_qt.py", line 1137, in select_item
    self.preview_panel.update_widgets()
  File "/home/icosahunter/Repos/TagStudio/tagstudio/src/qt/widgets/preview_panel.py", line 539, in update_widgets
    f"{filepath.suffix.upper()[1:]}  •  {format_size(os.stat(filepath).st_size)}"
                                                     ^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/home/icosahunter/Documents/test.txt'
Start RMF: <PySide6.QtCore.QThread(0x55681a5ac5b0) at 0x7fc9d3f2d600>
TagStudio.sh: line 7:  9544 Segmentation fault      (core dumped) python tagstudio/tag_studio.py

Icosahunter avatar May 26 '24 21:05 Icosahunter