Re: [dev] RFC: Transaction meta data

Jim Fulton <[email protected]>
Newsgroups gmane.comp.web.zope.zodb
Message-ID <CAPDm-FjSJVWqvkWPNOqFqJo3AWzj=dGB+-FVmhpxxV-piW4qfw@mail.gmail.com>
On Thu, Mar 9, 2017 at 1:38 PM, Jim Fulton <[email protected]> wrote:

>
>
> On Thu, Mar 9, 2017 at 1:02 PM, Hanno Schlichting <[email protected]>
> wrote:
>
>> On Thu, Mar 9, 2017, at 18:58, Jim Fulton wrote:
>>
> ...

> At least in older Zope 2 releases, both None and integers are used in meta
>> data as well.
>>
>
> whimper.  Well, None I'd be inclined to treat at a noop.
> <http://jimfulton.info>
>

There didn't seem to be any objections to treating None as a noop. I
suggested that because I assumed that None was being passed because it was
some default somewhere.

...

I was being lazy. I just looked at the ZODB 4 and transaction 1 code:

- Passing None or an int to note() would have error-ed, because note()
strips it's argument.

- Setting description or user to None would have caused FileStorage to
error, because it gets their lengths.  There was no code that I could see
that stringifies these either, so I don't think anything was assigning them
directly.

I'm guessing that None can be passed as the user to setUser, which makes
perfect sense, for unauthenticated requests.

Oh, and I bet integers principal ids are passed to getUser as well.

How'm I doing?

If my analysis is correct, assigning directly to user or description with
anything other than text or bytes should error, as it did before.  Ditto
for passing anything but text or bytes to note(). setUser can continue to
stringify with a warning.

What do you think?

Help me out here folks. :)

Jim

-- 
Jim Fulton
http://jimfulton.info

-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.