obsproject / obsproject/obs-studio
Python scripting 'stderr_logger' does not reimplement 'isatty'
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 76.4k
- Forks
- 10.2k
- Avg merge
- 4d 23h
- Merged PRs (30d)
- 12
Description
Operating System Info
Other
Other OS
Manjaro Linux, Kernel 5.12
OBS Studio Version
26.1.2
OBS Studio Version (Other)
No response
OBS Studio Log URL
None
OBS Studio Crash Log URL
Not crashed
Expected Behavior
Want to use the Python package youtube_dl inside my OBS Script.
Current Behavior
Throws a Python Error AttributeError: 'stderr_logger' object has no attribute 'isatty' in the Script Log window.
See: https://github.com/ytdl-org/youtube-dl/issues/28914
Steps to Reproduce
- Create a simple script barebone.
import youtube_dlpackage.- Instantiate it by
parser = youtube_dl.YoutubeDL(...). - Call it by:
parser.extract_info(...).
In contrast, running the following standalone example script outside of OBS wil NOT reproduce the issue:
#!/usr/bin/env python3
import youtube_dl as ydl
url = "https://www.youtube.com/watch?v=6qEzh3wKVJc"
with ydl.YoutubeDL(
{
"forcejson": True,
"noplaylist": True,
"format": "bestaudio"
}
) as parser:
meta = parser.extract_info(
url,
download=False
)
print(meta['thumbnail'])
print(meta['title'])
print(meta['url'])
Anything else we should know?
Workaround: https://github.com/ytdl-org/youtube-dl/issues/28914#issuecomment-829739392
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the Python scripting logger implementation for the stderr_logger object and reproduce the error by importing youtube_dl and calling YoutubeDL.extract_info(...) from an OBS script. The work is done when that interaction no longer raises the missing isatty error and the relevant script-logging behavior is covered by an appropriate test, if one exists.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100