Path: csiph.com!news.swapon.de!fu-berlin.de!uni-berlin.de!not-for-mail From: eryk sun Newsgroups: comp.lang.python Subject: Re: cannot open file with non-ASCII filename Date: Tue, 15 Dec 2015 09:34:17 -0600 Lines: 25 Message-ID: References: <20151214221751.GM12472@rus.uni-stuttgart.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: news.uni-berlin.de 205FZg/EoX/KCqQfPMm83QYHMRoh7Na4xbhedoW3RF8w== Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.000 X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'received:209.85.223': 0.03; 'modify': 0.04; 'url:bitbucket': 0.05; 'pypy': 0.07; 'subject:file': 0.07; 'wrapped': 0.07; 'api': 0.09; '[1]:': 0.09; '[2]:': 0.09; 'creighton': 0.09; 'high-level': 0.09; 'patches': 0.09; 'url:github': 0.09; 'url:pypy': 0.09; 'files.': 0.13; 'ignores': 0.16; 'received:io': 0.16; 'received:psf.io': 0.16; 'subject:non': 0.16; 'timeout.': 0.16; 'url:py': 0.16; 'wrote:': 0.16; 'looked': 0.16; 'laura': 0.18; 'input': 0.18; 'windows': 0.20; '2015': 0.20; 'cc:2**0': 0.20; 'ctypes': 0.22; 'am,': 0.23; 'wrote': 0.23; 'dec': 0.23; 'header:In-Reply-To:1': 0.24; 'message-id:@mail.gmail.com': 0.27; 'see,': 0.27; 'turns': 0.27; 'function': 0.28; '(used': 0.29; 'promising': 0.29; 'work.': 0.30; '15,': 0.30; 'probably': 0.31; 'useful': 0.33; 'tue,': 0.34; 'file': 0.34; 'received:google.com': 0.35; 'todo': 0.35; 'url:org': 0.36; 'received:209.85': 0.36; 'modules': 0.36; 'to:addr:python-list': 0.36; 'subject:: ': 0.37; 'received:209': 0.38; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'subject:with': 0.40; 'your': 0.60; 'here.': 0.62; 'url:4': 0.70; 'url:master': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=F4FYwFV4AqlDZUuuaX5naQwcD6enuXTHwzqLbCYBAy4=; b=pcyiVFWsHnDg/7E2IxiDKoROt47xqDf7neeNBm6JS+Gc6a6rO8Dkn/iGGdn1a6gcKt jN4saIb2uPFI/Qg9+Bfw9/kuFRlgsPPN/EOBN9NFf/QDRNSLpR8JS4phdhE5o6fnsmRk GJEr9IINKrQWJk7uZz66uVQNDwULu1TbmWxTA/i/zb7cPZGroP+bHsybzl0WDnfC1yXQ n6RQeqoBM+4eHwjT6bh/BzZEz4YNMuCGO/gtVkU/dzBVmN6mdg5FdCeImjdb0rD9jjTY kL1QX0h8HUgTlmMycfVBEQlP6QUahPwEJcSIC1ddaV3LJ1OOZx7H4ZN6gUoxHwCa72Bv LX1g== X-Received: by 10.107.164.227 with SMTP id d96mr34382363ioj.73.1450193696904; Tue, 15 Dec 2015 07:34:56 -0800 (PST) In-Reply-To: X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.20+ Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Xref: csiph.com comp.lang.python:100464 On Tue, Dec 15, 2015 at 2:26 AM, Ulli Horlacher wrote: > Laura Creighton wrote: > >> PyPy wrote its own pyreadline. >> You can get it here. https://bitbucket.org/pypy/pyrepl > > As far as I can see, it has no getkey function. > My users do not hit ENTER after drag&drop or copy&paste files. > I need an input function with a timeout. pyreadline looked promising for its extensive ctypes implementation of the Windows console API [1], wrapped by high-level methods such as peek, getchar, and getkeypress. It turns out it ignores the event sequences you need for alt+numpad input (used when a file is dragged into the console). You'd have to modify its console and keysyms modules to make it work. It would be a useful enhancement, so probably your patches would be accepted upstream. AFAICT, pyrepl has no Windows support. Check the TODO [2]: > + port to windows [1]: https://github.com/pyreadline/pyreadline/blob/master/pyreadline/console/console.py [2]: https://bitbucket.org/pypy/pyrepl/src/62f2256014af7b74b97c00827f1a7789e00dd814/TODO?at=v0.8.4