Skip to content

生成PDF时异常 #13

Closed
Closed

Description

@waynevan

Activity

  1. waynevan commented on Mar 5, 2021

    @waynevan
    Author
  2. Algebra-FUN commented on Mar 21, 2021

    @Algebra-FUN
    Owner

    @waynevan
    抱歉,没有及时回复,本人大三,学业繁忙,无暇顾及,望谅解

  3. Algebra-FUN commented on Mar 21, 2021

    @Algebra-FUN
    Owner

    https://ibb.co/KDqpXKj

    这个是应为“章节名称”中“建立发送/接受”中“/”所导致的,这个与路径用的"/"重复;
    确实我开发经验不足,没有考虑到这些特殊字符的影响,没有做"Escape Character",是我的失误,感谢你的反馈

  4. love1900905 commented on Oct 9, 2022

    @love1900905

    可以用uuid模块,用于解决书名和章节名中有特殊字符的情况
    生成如下的目录/文件:
    wrs-temp/88bda22c-cbab-459b-a7ca-430301e0347a/aea20dc8-44cc-4a61-b781-5c370956f918.png

    #import uuid
    
    book_dir_name = str(uuid.uuid4())
    dir_check(f'wrs-temp/{book_dir_name}')
    ......
    png_name = f'wrs-temp/{book_dir_name}/{str(uuid.uuid4())}'
    
  5. Algebra-FUN commented on Oct 10, 2022

    @Algebra-FUN
    Owner

    可以用uuid模块,用于解决书名和章节名中有特殊字符的情况 生成如下的目录/文件: wrs-temp/88bda22c-cbab-459b-a7ca-430301e0347a/aea20dc8-44cc-4a61-b781-5c370956f918.png

    #import uuid
    
    book_dir_name = str(uuid.uuid4())
    dir_check(f'wrs-temp/{book_dir_name}')
    ......
    png_name = f'wrs-temp/{book_dir_name}/{str(uuid.uuid4())}'
    

    Good suggestion. It's a good solution for escaping special characters in the chapter name, but it isn't suitable for the book name since users want to see the real book name. Anyway, if you have time, you can create a pull request to merge your solution to this repository. We will thank you for your contribution.

  6. love1900905 commented on Oct 10, 2022

    @love1900905

    可以用uuid模块,用于解决书名和章节名中有特殊字符的情况 生成如下的目录/文件: wrs-temp/88bda22c-cbab-459b-a7ca-430301e0347a/aea20dc8-44cc-4a61-b781-5c370956f918.png

    #import uuid
    
    book_dir_name = str(uuid.uuid4())
    dir_check(f'wrs-temp/{book_dir_name}')
    ......
    png_name = f'wrs-temp/{book_dir_name}/{str(uuid.uuid4())}'
    

    Good suggestion. It's a good solution for escaping special characters in the chapter name, but it isn't suitable for the book name since users want to see the real book name. Anyway, if you have time, you can create a pull request to merge your solution to this repository. We will thank you for your contribution.

    The book_name keeps untouched. book_dir_name is just used for saving temp files.
    (and, the book name need still might buggy in case it contains special characters for file name; this is another not fixed bug :))

    btw, the only 4 lines code changes are as above mentioned, thus pull request not needed :)

  7. Repository owner locked and limited conversation to collaborators on Oct 12, 2022
  8. converted this issue into a discussion #30 on Oct 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions