On 6 September 2012 16:34, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
> On Thu, 06 Sep 2012 00:34:56 +, Antoine Pitrou wrote:
> > Monkey-patching globals is not thread-safe: other threads will see your
>
> modification, which is risky and fragile.
>
> Isn't that assuming th
On Thu, 06 Sep 2012 00:34:56 +, Antoine Pitrou wrote:
> Chris Angelico gmail.com> writes:
>>
>> On Wed, Sep 5, 2012 at 5:16 AM, Terry Reedy udel.edu>
>> wrote:
>> > io.open depends on a function the returns an open file descriptor.
>> > opener exposes that dependency so it can be replaced.
Chris Angelico gmail.com> writes:
>
> On Wed, Sep 5, 2012 at 5:16 AM, Terry Reedy udel.edu> wrote:
> > io.open depends on a function the returns an open file descriptor. opener
> > exposes that dependency so it can be replaced.
>
> I skimmed the bug report comments but didn't find an answer to
On 9/4/2012 6:18 PM, Chris Angelico wrote:
On Wed, Sep 5, 2012 at 5:16 AM, Terry Reedy wrote:
io.open depends on a function the returns an open file descriptor. opener
exposes that dependency so it can be replaced.
I skimmed the bug report comments but didn't find an answer to this:
Why not j
On Wed, Sep 5, 2012 at 5:16 AM, Terry Reedy wrote:
> io.open depends on a function the returns an open file descriptor. opener
> exposes that dependency so it can be replaced.
I skimmed the bug report comments but didn't find an answer to this:
Why not just monkey-patch? When a module function ca
On 9/4/2012 8:58 AM, Serhiy Storchaka wrote:
On 04.09.12 04:13, Steven D'Aprano wrote:
Why does the open builtin need this added complexity? Why not just call
os.open directly? Or for more complex openers, just call the opener
directly?
What is the rationale for complicating open instead of tel
On 03.09.12 15:32, Marco wrote:
Does anyone have an example of utilisation?
http://bugs.python.org/issue13424
--
http://mail.python.org/mailman/listinfo/python-list
On 04.09.12 04:13, Steven D'Aprano wrote:
Why does the open builtin need this added complexity? Why not just call
os.open directly? Or for more complex openers, just call the opener
directly?
What is the rationale for complicating open instead of telling people to
just call their opener directly
Steven D'Aprano writes:
> On Mon, 03 Sep 2012 23:19:51 -0400, Dennis Lee Bieber wrote:
> > f = os.fdopen(os.open("newfile", flags | os.O_EXCL), "w")
> >
> > which does NOT look any cleaner to me...
>
> Well, I don't know about that. Once you start messing about with low-
> level O_* flags,
On Mon, 03 Sep 2012 23:19:51 -0400, Dennis Lee Bieber wrote:
> On 04 Sep 2012 01:13:09 GMT, Steven D'Aprano
> declaimed the following in
> gmane.comp.python.general:
>
>
>
>> Why does the open builtin need this added complexity? Why not just call
>> os.open directly? Or for more complex opener
Ben Finney writes:
> So, having written the opener:
>
> > On Mon, 03 Sep 2012 15:29:05 +0200, Christian Heimes wrote:
> > > import os
> > >
> > > def opener(file, flags):
> > > return os.open(file, flags | os.O_EXCL)
>
> why not call that directly?
>
> f = opener(file, flags)
Ah, becaus
Dennis Lee Bieber writes:
> On 04 Sep 2012 01:13:09 GMT, Steven D'Aprano
> declaimed the following in
> gmane.comp.python.general:
> > What is the rationale for complicating [the builtin] open instead of
> > telling people to just call their opener directly?
>
> To avoid the new syntax wou
On Mon, 03 Sep 2012 15:29:05 +0200, Christian Heimes wrote:
> Am 03.09.2012 14:32, schrieb Marco:
>> Does anyone have an example of utilisation?
>
> The opener argument is a new 3.3 feature. For example you can use the
> feature to implement exclusive creation of a file to avoid symlink
> attacks
On 03.09.12 16:29, Christian Heimes wrote:
Am 03.09.2012 14:32, schrieb Marco:
Does anyone have an example of utilisation?
The opener argument is a new 3.3 feature. For example you can use the
feature to implement exclusive creation of a file to avoid symlink attacks.
Or you can use new dir_
On 09/03/2012 03:05 PM, Dave Angel wrote:
Does anyone have an example of utilisation?
As of Python 3.2.3, there is no "opener" parameter in the open() function.
http://docs.python.org/py3k/library/functions.html
I don't know of any such parameter in earlier or later versions, but I
coul
Am 03.09.2012 14:32, schrieb Marco:
> Does anyone have an example of utilisation?
The opener argument is a new 3.3 feature. For example you can use the
feature to implement exclusive creation of a file to avoid symlink attacks.
import os
def opener(file, flags):
return os.open(file, flags |
On 09/03/2012 08:32 AM, Marco wrote:
> Does anyone have an example of utilisation?
As of Python 3.2.3, there is no "opener" parameter in the open() function.
http://docs.python.org/py3k/library/functions.html
I don't know of any such parameter in earlier or later versions, but I
could be wron
Does anyone have an example of utilisation?
--
http://mail.python.org/mailman/listinfo/python-list
18 matches
Mail list logo