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

os.startfile() still doesn't work with Unicode filenames #43041

Closed
roee88 mannequin opened this issue Mar 16, 2006 · 8 comments
Closed

os.startfile() still doesn't work with Unicode filenames #43041

roee88 mannequin opened this issue Mar 16, 2006 · 8 comments
Assignees
Labels
extension-modules C modules in the Modules dir

Comments

@roee88
Copy link
Mannequin

roee88 mannequin commented Mar 16, 2006

BPO 1451503
Nosy @loewis, @theller, @birkenfeld, @birkenfeld
Files
  • startfile-unicode.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/birkenfeld'
    closed_at = <Date 2006-04-03.23:04:30.000>
    created_at = <Date 2006-03-16.18:08:27.000>
    labels = ['extension-modules']
    title = "os.startfile() still doesn't work with Unicode filenames"
    updated_at = <Date 2006-04-03.23:04:30.000>
    user = 'https://bugs.python.org/roee88'

    bugs.python.org fields:

    activity = <Date 2006-04-03.23:04:30.000>
    actor = 'loewis'
    assignee = 'georg.brandl'
    closed = True
    closed_date = None
    closer = None
    components = ['Extension Modules']
    creation = <Date 2006-03-16.18:08:27.000>
    creator = 'roee88'
    dependencies = []
    files = ['1925']
    hgrepos = []
    issue_num = 1451503
    keywords = []
    message_count = 8.0
    messages = ['27797', '27798', '27799', '27800', '27801', '27802', '27803', '27804']
    nosy_count = 5.0
    nosy_names = ['loewis', 'theller', 'georg.brandl', 'georg.brandl', 'roee88']
    pr_nums = []
    priority = 'normal'
    resolution = 'accepted'
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1451503'
    versions = ['Python 2.4']

    @roee88
    Copy link
    Mannequin Author

    roee88 mannequin commented Mar 16, 2006

    From 2.4.2 changelog:

    >>Bug bpo-1007046: os.startfile() did not accept
    unicode strings encoded in the file system encoding.

    If the filename is unicode type and the encoding
    isn't the default system encoding, all "unknown" (to
    system encoding) characters are replaced by "?".
    This is causing the os.startfile() to fail with
    WindowsError: [Errno2]
    Because the filename doesn't really have the "?".

    @roee88 roee88 mannequin closed this as completed Mar 16, 2006
    @roee88 roee88 mannequin assigned birkenfeld Mar 16, 2006
    @roee88 roee88 mannequin added the extension-modules C modules in the Modules dir label Mar 16, 2006
    @roee88 roee88 mannequin closed this as completed Mar 16, 2006
    @roee88 roee88 mannequin assigned birkenfeld Mar 16, 2006
    @roee88 roee88 mannequin added the extension-modules C modules in the Modules dir label Mar 16, 2006
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Mar 19, 2006

    Logged In: YES
    user_id=21627

    Well, it does work on Unicode strings when all characters
    from the string come from the system code page; this got
    implemented in response to bug bpo-1007046.

    To fix this, the implementation should use ShellExecuteW
    (except on Win9x). Would you like to work on a patch?

    As a work-around, change your system code page so your file
    names are supported.

    @roee88
    Copy link
    Mannequin Author

    roee88 mannequin commented Mar 22, 2006

    Logged In: YES
    user_id=1111143

    Sorry, but I can't work on a patch.

    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=849994

    Attaching patch. Please check.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Apr 3, 2006

    Logged In: YES
    user_id=21627

    The patch looks fine. Please apply.

    @birkenfeld
    Copy link
    Member

    Logged In: YES
    user_id=849994

    Rev. 43586.

    @theller
    Copy link

    theller commented Apr 3, 2006

    Logged In: YES
    user_id=11105

    The patched file does not even compile.
    I suggest a more careful review, or running the testsuite
    (on affected system), or even better, a unittest.

    @loewis
    Copy link
    Mannequin

    loewis mannequin commented Apr 3, 2006

    Logged In: YES
    user_id=21627

    For the record: the patch *does* compile (though with
    warnings), and passes the test suite, see the buildbot log
    files for details.

    Nevertheless, there were two serious bugs in the code, which
    I fixed in 43611. Thanks for pointing that out.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    extension-modules C modules in the Modules dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants