8000 Change of behaviour when converting DirectoryPath to pathlib.Path with python 3.12 · Issue #3 · xapple/autopaths · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Change of behaviour when converting DirectoryPath to pathlib.Path with python 3.12 #3
Open
@paulrougieux

Description

@paulrougieux

This isn't a problem with python 3.11 (tested in a conda environment on the same machine). It appears in python 3.12 on windows. The error returned prevents paths from being built. The fix is simply to cast the authopath object to a string first. Maybe it's not an issue with autopaths.

import pathlib
from autopaths.dir_path import DirectoryPath
p_autopaths = DirectoryPath("~")

# This is generating an error on Windows with python 3.12
p1 = pathlib.Path(p_autopaths)
print(p1 / "test")

# This is not generating the error
p2 = pathlib.Path(str(p_autopaths))
print(p2 / "test")

Related to https://gitlab.com/bioeconomy/eu_cbm/eu_cbm_hat/-/issues/85

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

      0