> Is it possible a conversion from bytes (ANSI) to unicode fails on
> windows?
It should fail sometimes, right? Not for windows-1252, but certainly
for shift-jis (you know better than me). It seems that whether
MultiByteToWideChar will fail depends on whether MB_ERR_INVALID_CHARS
is given or not.
On 2010/11/12 1:18, Ulrich Eckhardt wrote:
# I recently did it for winsound.PlaySound with MvL's approval
Interesting, is there a ticket associate with this? Also, was that on Python 3
or 2? Which commits?
Sorry for late posting. Rev 86300 and Issue 6317.
_
On 2010/11/14 9:06, Victor Stinner wrote:
Yes, but how do you check if the input argument is a bytes or a str object
with your PyArg_Parse converter? You should use "O" format and manually
convert it to unicode, and then convert the result back to bytes (if the input
was bytes). It don't think th
On Sun, Nov 14, 2010 at 8:14 PM, "Martin v. Löwis" wrote:
> I'm in favor of deprecating it first.
Aye. I've made the best case I could for keeping it, and even I don't
find it terribly convincing. So deprecation for 3.2 sound like a
reasonable option.
Regards,
Nick.
--
Nick Coghlan | ncogh
> We should also keep in mind that *Microsoft* have chosen to keep the
> bytes Win32 APIs around, despite their flaws, all in the name of
> backwards compatibility.
Of course, Microsoft is in a different position. If they remove a
functionality in some release, their users typically can't go back
> If the code is currently working and isn't a security hole, then we
> obviously don't "have to".
> Apparently several developers "want to", which is different.
In case the motivation for that isn't clear: it would produce a
significant code reduction, and therefore ease maintenance.
Regards,
Ma
On Sun, Nov 14, 2010 at 10:19 AM, Antoine Pitrou wrote:
> On Sun, 14 Nov 2010 01:06:55 +0100
> Victor Stinner wrote:
>>
>> The code is currently working. The question is if we have to drop the ANSI
>> API
>> now, later or never.
>
> If the code is currently working and isn't a security hole, the
On Sun, 14 Nov 2010 01:06:55 +0100
Victor Stinner wrote:
>
> The code is currently working. The question is if we have to drop the ANSI
> API
> now, later or never.
If the code is currently working and isn't a security hole, then we
obviously don't "have to".
Apparently several developers "wan
On Saturday 13 November 2010 17:21:37 you wrote:
> On 2010/11/12 4:26, Victor Stinner wrote:
> > On Thursday 11 November 2010 17:07:28 Hirokazu Yamamoto wrote:
> >> Hello. Is it possible to remove Win32 ANSI API (ie: GetFileAttributesA)
> >> and only use Win32 WIDE API (ie: GetFileAttributesW)?
On 2010/11/12 4:26, Victor Stinner wrote:
> On Thursday 11 November 2010 17:07:28 Hirokazu Yamamoto wrote:
>> Hello. Is it possible to remove Win32 ANSI API (ie: GetFileAttributesA)
>> and only use Win32 WIDE API (ie: GetFileAttributesW)?
>> Mainly in posixmodule.c.
>
> Even if I hate the MBCS enc
On Sat, Nov 13, 2010 at 5:46 AM, "Martin v. Löwis" wrote:
>> Ok, good answer. In this case, I vote +1 to remove completly the ANSI version
>> from all Python modules.
>
> I think caution is still necessary. So I propose to deprecate byte
> filenames on Windows in 3.2, with removal in 3.3. People w
> Ok, good answer. In this case, I vote +1 to remove completly the ANSI version
> from all Python modules.
I think caution is still necessary. So I propose to deprecate byte
filenames on Windows in 3.2, with removal in 3.3. People who think this
is a terrible mistake and breaks there applications
> I'm not talking about Windows obviously. POSIX filenames are natively
> bytes, so if you get a bytes filename from an external source, it makes
> sense to reuse the bytes form.
>
> I think it would be a mistake to allow bytes filenames under POSIX but
> not under Windows. It makes porting harder
On Fri, 12 Nov 2010 13:13:08 +0100
Victor Stinner wrote:
> On Thursday 11 November 2010 21:02:43 Antoine Pitrou wrote:
> > On Thu, 11 Nov 2010 20:44:52 +0100
> >
> > "Martin v. Löwis" wrote:
> > > > How do you support cross-platform code using bytes filenames?
> > > > IIRC, it has already been a
On Thursday 11 November 2010 20:50:35 you wrote:
> > Even if I hate the MBCS encoding, because it replaces undecodable
> > characters by similar glyphs by default, I'm not certain that it is a
> > good idea to drop the bytes API. Can it be a problem to port programs
> > from Python2 to Python3? Do
On Thursday 11 November 2010 21:02:43 Antoine Pitrou wrote:
> On Thu, 11 Nov 2010 20:44:52 +0100
>
> "Martin v. Löwis" wrote:
> > > How do you support cross-platform code using bytes filenames?
> > > IIRC, it has already been argued that it was an important feature. Many
> > > filesystem-related
On Thursday 11 November 2010 23:01:32 you wrote:
> > Sure, it will divide the number of lines, of the code specific to
> > Windows, by two.
>
> Can we get most of the code cleanup benefit without the backwards
> compatibility risk by doing the decode from 'mbcs' on our side of the
> fence?
I crea
> Additionally:
>
> d) Over a socket (like the HTTP protocol) -> Bytes.
Sure. However, you can't really expect that the bytes you receive
over the socket are a meaningful filename on your local Windows
installation. So it would be a bug in the application to not decode
the bytes that you receive
On Thursday 11 November 2010 20:50:35 Martin v. Löwis wrote:
> > Even if I hate the MBCS encoding, because it replaces undecodable
> > characters by similar glyphs by default, I'm not certain that it is a
> > good idea to drop the bytes API. Can it be a problem to port programs
> > from Python2 to
On Fri, Nov 12, 2010 at 5:26 AM, Victor Stinner
wrote:
> On Thursday 11 November 2010 17:07:28 Hirokazu Yamamoto wrote:
>> Hello. Is it possible to remove Win32 ANSI API (ie: GetFileAttributesA)
>> and only use Win32 WIDE API (ie: GetFileAttributesW)?
>> Mainly in posixmodule.c.
>
> Even if I hate
On Thu, 11 Nov 2010 20:44:52 +0100
"Martin v. Löwis" wrote:
> > How do you support cross-platform code using bytes filenames?
> > IIRC, it has already been argued that it was an important feature. Many
> > filesystem-related utilities might prefer to handle filenames in bytes
> > form.
>
> It wou
> Even if I hate the MBCS encoding, because it replaces undecodable characters
> by similar glyphs by default, I'm not certain that it is a good idea to drop
> the bytes API. Can it be a problem to port programs from Python2 to Python3?
> Do major Python2 programs/libraries rely on the bytes API
> How do you support cross-platform code using bytes filenames?
> IIRC, it has already been argued that it was an important feature. Many
> filesystem-related utilities might prefer to handle filenames in bytes
> form.
It would be a policy decision. However, I think it is hear-say that
filesystem-
On Thursday 11 November 2010 17:07:28 Hirokazu Yamamoto wrote:
> Hello. Is it possible to remove Win32 ANSI API (ie: GetFileAttributesA)
> and only use Win32 WIDE API (ie: GetFileAttributesW)?
> Mainly in posixmodule.c.
Even if I hate the MBCS encoding, because it replaces undecodable characters
On Thu, 11 Nov 2010 16:10:35 +
Tim Golden wrote:
> On 11/11/2010 16:07, Hirokazu Yamamoto wrote:
> > Hello. Is it possible to remove Win32 ANSI API (ie: GetFileAttributesA)
> > and only use Win32 WIDE API (ie: GetFileAttributesW)?
> > Mainly in posixmodule.c.
> > I think we can simplify the co
On Thursday 11 November 2010, Hirokazu Yamamoto wrote:
> Is it possible to remove Win32 ANSI API (ie: GetFileAttributesA)
> and only use Win32 WIDE API (ie: GetFileAttributesW)?
> Mainly in posixmodule.c.
> I think we can simplify the code hugely.
+1
MS Windows variants that only support the ANSI
On 11/11/2010 16:07, Hirokazu Yamamoto wrote:
Hello. Is it possible to remove Win32 ANSI API (ie: GetFileAttributesA)
and only use Win32 WIDE API (ie: GetFileAttributesW)?
Mainly in posixmodule.c.
I think we can simplify the code hugely. (This means droping bytes
support for os.stat etc on window
Hello. Is it possible to remove Win32 ANSI API (ie: GetFileAttributesA)
and only use Win32 WIDE API (ie: GetFileAttributesW)?
Mainly in posixmodule.c.
I think we can simplify the code hugely. (This means droping bytes
support for os.stat etc on windows)
# I recently did it for winsound.PlaySound
28 matches
Mail list logo