question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Job's __unicode__ method leads to misleading representations

See original GitHub issue

Expected Behavior

When printing job or converting one to string, I’d expect to see an indication that it is the Job object I’m operating on.

Current Behavior

Job prints its name followed by parenthesis and some properties. If the name is misleading (eg. MagicMock), the job disguises itself as something else.

Steps to Reproduce

task = MagicMock()
job = scheduler.add_job(task, ...)
print(job)
>>> MagicMock (trigger:...)

Context (Environment)

It is confusing and potentially error-prone when debugging or serialising Jobs.

Detailed Description

I suggest that Job should always print Job at the beginning when converting to unicode.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
agronholmcommented, Feb 12, 2021

@Voyz please subscribe to #465 to keep updated on the progress.

0reactions
Voyzcommented, Feb 12, 2021

hey @agronholm just following up on these two questions I posted last time. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

How Unicode Works: What Every Developer Needs to ...
Unicode characters can be referenced by their code point. This Stack Overflow article does a good job of explaining what a code point...
Read more >
10 Understanding Unicode Compliance Standards
The Unicode Standard is the universal character-encoding scheme for written characters and text. It defines a consistent way of way of encoding multilingual ......
Read more >
Unicode & Character Encodings in Python: A Painless Guide
In this tutorial, you'll get a Python-centric introduction to character encodings and unicode. Handling character encodings and numbering systems can at ...
Read more >
How to get string objects instead of Unicode from JSON
Purely for performance. Mark's answer decodes the JSON text fully first with Unicode strings, then recurses through the entire decoded value to convert...
Read more >
Unicode, UTF8 & Character Sets: The Ultimate Guide
A potentially misleading function is utf8_decode . It turns UTF-8 into ISO-8859-1. Any characters not available in ISO-8859-1 (like Cyrillic, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found