Re: [Python-Dev] Use our strict mbcs codec instead of the Windows ANSI API
Le Mardi 25 Octobre 2011 10:31:56 Victor Stinner a écrit :
>> Basically, all functions processing filenames, so most functions of
>> posixmodule.c. Some examples:
>>
>> - os.listdir(): FindFirstFileA, FindNextFileA, FindCloseA
>> - os.lstat(): CreateFileA
>> - os.getcwdb(): getcwd()
>> - os.mkdir(): CreateDirectoryA
>> - os.chmod(): SetFileAttributesA
>> - ...
> This seems way too broad.
I changed my mind about this list: I only want to change how filenames are
encoded, not how filenames are decoded. So only os.listdir() & os.getcwdb()
should be changed, as I wrote in another email in this thread and in the issue
#13247.
>> - os.getcwdb():
> This you might change.
Issue #13247 combines os.getcwdb() and os.listdir(). Read the issue for more
information.
> It ('?') is a bad choice of signal though, given the other uses
> of '?' in paths.
If I understood correctly, '?' is a pattern to match any character in
FindFirstFile/FindNextFile. Python cannot configure the replacement character,
it's hardcoded to "?" (U+003F).
> it's just
> standard Windows behavior, which results in pathnames that are
> perfectly acceptable to Windows APIs, but unreliable in use because
> they have different semantics in different Windows APIs.
I think that such filenames cannot be used with any Windows function accessing
to the filesystem. Extract of the issue:
"Such filenames cannot be used, open() fails with OSError(22, "invalid
argument: '?'") for example."
You can only be used if you want to display the content of a directory, but
don't expect to be able to read file content.
--
Anyway, you must use Unicode on Windows! The bytes API was just kept for
backward compatibility.
Victor
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] [Python-checkins] r88914 - tracker/instances/python-dev/html/issue.item.js
Hi,
On Wed, Oct 26, 2011 at 11:45 AM, ezio.melotti
wrote:
> Author: ezio.melotti
> Date: Wed Oct 26 10:45:41 2011
> New Revision: 88914
>
> Log:
> Mark automated messages with a different background.
>
> Modified:
> tracker/instances/python-dev/html/issue.item.js
>
> Modified: tracker/instances/python-dev/html/issue.item.js
> ==
> --- tracker/instances/python-dev/html/issue.item.js (original)
> +++ tracker/instances/python-dev/html/issue.item.js Wed Oct 26 10:45:41
> 2011
> @@ -313,3 +313,14 @@
> if (link.length != 0)
> link.attr('href', link.attr('href').split('?')[0]);
> });
> +
> +
> +$(document).ready(function() {
> + /* Mark automated messages with a different background */
> + $('table.messages th:nth-child(2)').each(function (i, e) {
> + var e = $(e);
> + if (/\(python-dev\)$/.test(e.text()))
> + e.parent().next().find('td.content').css(
> + 'background-color', '#efeff9');
> + });
> +});
I think this is shorter than $(document).ready();
$(function() {
// ...
});
See:
http://stackoverflow.com/questions/3528509/document-readyfunction-vs-function/3528528#3528528
--Berker
> ___
> Python-checkins mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/python-checkins
>
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
Re: [Python-Dev] [Python-checkins] r88914 - tracker/instances/python-dev/html/issue.item.js
Hi,
On 26/10/2011 12.39, Berker Peksağ wrote:
Hi,
I think this is shorter than $(document).ready();
$(function() {
// ...
});
See:
http://stackoverflow.com/questions/3528509/document-readyfunction-vs-function/3528528#3528528
Thanks a lot for the review, I didn't know about this shortcut!
However I think I'll just leave $(document).ready(...); because, even if
longer, is more explicit and readable.
Best Regards,
Ezio Melotti
--Berker
___
Python-Dev mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe:
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com
