Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pytest html file in a Chinese path, there ate some error #797

Open
Mutiantian opened this issue Jan 30, 2024 · 2 comments
Open

pytest html file in a Chinese path, there ate some error #797

Mutiantian opened this issue Jan 30, 2024 · 2 comments

Comments

@Mutiantian
Copy link

Mutiantian commented Jan 30, 2024

pytest html file in a Chinese path, there ate some error

in pure english path:
企业微信截图_17066134131866

path has some Chinese
企业微信截图_17066130942020

@Mutiantian
Copy link
Author

const hideCategory = (categoryToHide) => {
    const url = new URL(window.location.href)
    const visibleParams = new URLSearchParams(url.search).get('visible')
    const currentVisible = visibleParams ? visibleParams.split(',') : [...possibleFilters]
    const settings = [...new Set(currentVisible)].filter((f) => f !== categoryToHide).join(',')

    url.searchParams.set('visible', settings)
    try {
    window.history.pushState(null, null, url);
    } catch (error) {
        console.error("Failed to push state to history: " + error);
    }

}
const showCategory = (categoryToShow) => {
    if (typeof window === 'undefined') {
        return
    }
    const url = new URL(window.location.href)
    const currentVisible = new URLSearchParams(url.search).get('visible')?.split(',').filter(Boolean) ||
        [...possibleFilters]
    const settings = [...new Set([categoryToShow, ...currentVisible])]
    const noFilter = possibleFilters.length === settings.length || !settings.length

    noFilter ? url.searchParams.delete('visible') : url.searchParams.set('visible', settings.join(','))
    try {
    window.history.pushState(null, null, url);
    } catch (error) {
        console.error("Failed to push state to history: " + error);
    }
}
const setSort = (type) => {
    const url = new URL(window.location.href)
    url.searchParams.set('sort', type)
    try {
    window.history.pushState(null, null, url);
    } catch (error) {
        console.error("Failed to push state to history: " + error);
    }
}

here should add some try catch

@ondrasouk
Copy link

The error manifests itself in any non-ASCII path.
I have a download folder that has the localized name "Stahování" (Czech localization) and I get the same error message in the browser console (Chromium, Firefox). Moving the report to a path that contains only ASCII characters fixes the report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants