PixivUtil2: "Download from Fanbox" function creates extra config.ini.bak and crashes

Prerequisites

  • [Y] Did you read FAQ section?
  • [Y] Did you test with the latest releases or commit ?

Description

When choosing “f1. Download from supported artists (FANBOX)” or “f2. Download by artist id (FANBOX)”, PixivUtil will create a config.ini.bak. The bak file will stay until next time an artist is loaded, then PixivUtil will crash and throw out an exception because the bak file is already there.

Max Page =
Getting supported artists from https://fanbox.pixiv.net/api/plan.listSupporting
Found 13 supported artist(s)
[<REDACTED>]
Processing <REDACTED>, page 1
Getting posts from https://fanbox.pixiv.net/api/post.listCreator?userId=<REDACTED>&limit=10
Using OAuth to retrieve member info for: <REDACTED>
Writing config file... Backing up old config to config.ini.bak
Traceback (most recent call last):
  File "PixivUtil2.py", line 2448, in main
  File "PixivUtil2.py", line 2183, in main_loop
  File "PixivUtil2.py", line 1923, in menu_fanbox_download_supported_artist
  File "PixivUtil2.py", line 1935, in processFanboxArtist
  File "PixivBrowserFactory.pyc", line 745, in fanboxGetPostsFromArtist
  File "PixivBrowserFactory.pyc", line 503, in getMemberInfoWhitecube
  File "PixivConfig.pyc", line 763, in writeConfig
FileExistsError: [WinError 183] 当文件已存在时,无法创建该文件。: 'F:\\pixivutil\\config.ini.tmp' -> 'F:\\pixivutil\\config.ini'
press enter to exit.

While I could manually delete the extra config.ini.bak, it wasn’t behaving like this a few versions before.

Versions

20200307

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 17 (8 by maintainers)

Commits related to this issue

Most upvoted comments

updated in latest commit to put explicit close() after writing the config file. I will upload beta version later.