JNCIA-DevOps Data Serialization Practice Question
An automation engineer is writing a Python script to push configurations to a Junos device. The script loads a YAML data file containing interface descriptions. One description contains a colon without a following space (e.g., 'Interface:Primary'). What error will PyYAML raise when attempting to parse this file?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
ScannerError
In YAML, a colon must be followed by a whitespace character to be recognized as a mapping key-value separator. If no space follows, PyYAML raises a ScannerError or MappingValuesError.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
TypeError
Why it's wrong here
Incorrect. TypeError is a Python runtime type error, not a YAML parsing scanner error.
- ✓
ScannerError
Why this is correct
Correct. Missing whitespace after a colon violates YAML mapping rules, resulting in a ScannerError.
- ✗
YAMLSemanticError
Why it's wrong here
Incorrect. YAMLSemanticError is not the standard PyYAML exception for syntax issues.
- ✗
JSONDecodeError
Why it's wrong here
Incorrect. JSONDecodeError is raised by the json module, not PyYAML.
About these practice questions
One of 306 original JNCIA-DevOps practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed August 2026 · checked against the official Juniper Networks exam blueprint
This JNCIA-DevOps practice question is part of Courseiva's free Juniper Networks certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the JNCIA-DevOps exam.