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

fsoids script fails reporting the shortened tid description on Python 3 #350

Closed
ale-rt opened this issue Aug 25, 2021 · 0 comments · Fixed by #351
Closed

fsoids script fails reporting the shortened tid description on Python 3 #350

ale-rt opened this issue Aug 25, 2021 · 0 comments · Fixed by #351

Comments

@ale-rt
Copy link
Member

ale-rt commented Aug 25, 2021

fsoids script fails reporting the shortened tid description on Python 3

What I did:

I ran the fsoids script passing one oid:

$ ./bin/fsoids components/zeo/var/filestorage/Data.fs 18104

What I expect to happen:

I expected this output:

$ ./bin/fsoids components/zeo/var/filestorage/Data.fs 18104
oid 0x46b8 ZODB.blob.Blob 2 revisions
    tid 0x03e1ec746d9d5a77 offset=32500086 2021-08-06 13:40:25.690936
        tid user=b' ale'
        tid description=b'/Plone/workspaces/open ... 787f6b6dfe6f.jpeg/index_html'
        new revision ZODB.blob.Blob at 32501238
        new revision ZODB.blob.Blob at 32501305
        referenced by 0x46b7 plone.namedfile.file.NamedBlobImage at 32500855

What actually happened:

oid 0x46b8 ZODB.blob.Blob 2 revisions
    tid 0x03e1ec746d9d5a77 offset=32500086 2021-08-06 13:40:25.690936
        tid user=b' ale'
Traceback (most recent call last):
  File "./bin/fsoids", line 319, in <module>
    sys.exit(ZODB.scripts.fsoids.main())
  File "/home/ale/.buildout/eggs/ZODB-5.6.0-py3.8.egg/ZODB/scripts/fsoids.py", line 76, in main
    c.report()
  File "/home/ale/.buildout/eggs/ZODB-5.6.0-py3.8.egg/ZODB/FileStorage/fsoids.py", line 120, in report
    print("        tid description=%r" % shorten(description))
  File "/home/ale/.buildout/eggs/ZODB-5.6.0-py3.8.egg/ZODB/FileStorage/fsoids.py", line 32, in shorten
    return s[:nleading] + " ... " + s[-ntrailing:]
TypeError: can't concat str to bytes

What version of Python and Zope/Addons I am using:

  • Python 3.8
  • ZODB-5.6.0
  • Zope-4.6.3
  • Plone-5.2.5
ale-rt added a commit that referenced this issue Aug 25, 2021
Fix ``TypeError: can't concat str to bytes`` when running fsoids.py script with Python 3.

Closes #350
icemac pushed a commit that referenced this issue Oct 28, 2021
Fix `TypeError: can't concat str to bytes` when running fsoids.py script with Python 3.

Closes #350
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 a pull request may close this issue.

1 participant