Skip to content

Fail to open PDF Files. "Could not find pdffile~" #22

@shga89

Description

@shga89

In the process of the opening original PDF files, this error below occurred.

"Could not find pdffile C:\C:\Users*\AppData\Local\Mendeley Ltd\Mendeley Desktop\Downloaded*.pdf"

The problem was the misrecognized file directory path, "C:\C:\".

"C:\" is duplicated twice.

I added one line to the coverturl2abspath method in the original code.

pth = pth.lstrip('/')

def converturl2abspath(URL):
    """Convert a url string to an absolute path"""
    try:
        pth = unquote(urlparse(url).path) #this is necessary for filenames with unicode strings
    except:
        pth = unquote(str(urlparse(url).path)).decode("utf8") #this is necessary for filenames with unicode strings
    pth = pth.lstrip('/')
    return os.path.abspath(pth)

After modifying the code, the adding annotations process had well-done, but I didn't modify the code in GitHub because I am not sure if this error occurs the same in all users.

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