You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Using a unicode string inside a timestamp context manager: with profile.timestamp(u"Adding_jobs"):
causes: TypeError: __name__ must be set to a string object
This can be caused with a normal looking Python string if you use from __future__ import unicode_literals (as I originally did) and the error message isn't as informative as it could be. The solution, if using the __future__ import is to force a binary sequence: with profile.timestamp(b"Adding_jobs"):
I mention this more just to help others spot the problem if they hit this error message.
The text was updated successfully, but these errors were encountered:
Thanks @ianozsvald ! Do you think it would be possible to allow unicode strings inside a timestamp context manager ? (if not, maybe a check in the TimeStamper.timestamp would be nice)
Using a unicode string inside a timestamp context manager:
with profile.timestamp(u"Adding_jobs"):
causes:
TypeError: __name__ must be set to a string object
This can be caused with a normal looking Python string if you use
from __future__ import unicode_literals
(as I originally did) and the error message isn't as informative as it could be. The solution, if using the__future__
import is to force a binary sequence:with profile.timestamp(b"Adding_jobs"):
I mention this more just to help others spot the problem if they hit this error message.
The text was updated successfully, but these errors were encountered: