Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZODB expect userid and description to be bytes #15

Closed
wants to merge 1 commit into from
Closed

ZODB expect userid and description to be bytes #15

wants to merge 1 commit into from

Conversation

gliheng
Copy link

@gliheng gliheng commented Jun 7, 2014

ZODB expect user and description to be bytes.

as in ZODB/FileStorage/format.py

def asString(self):
        s = struct.pack(TRANS_HDR, self.tid, self.tlen, as_bytes(self.status),
                        self.ulen, self.dlen, self.elen)
        return b"".join(map(as_bytes, [s, self.user, self.descr, self.ext]))

Chinese username or pathinfo will throw an exception here.

@gliheng gliheng closed this Jun 7, 2014
@gliheng gliheng reopened this Jun 7, 2014
@tseaver
Copy link
Member

tseaver commented Dec 14, 2014

Thank you for the patch! Unfortunately, the transaction actually needs the description and user to be native strings, so your fix won't work on Python3. I'm working on a fix based on #25.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants