Pope Pius XII
Divino Afflante Spiritu §3
Divino Afflante Spiritu: On Promoting Biblical Studies
3 The first and greatest care of Leo XIII was to set forth the teaching on the truth of the Sacred Books and to defend it from attack. Hence with grave words did he proclaim that there is no error whatsoever if the sacred writer, speaking of things of the physical order "went by what sensibly appeared" as the Angelic Doctor says, speaking either "in figurative language, or in terms which were commonly used at the time, and which in many instances are in daily use at this day, even among the most eminent men of science." For "the sacred writers, or to speak more accurately - the words are St. Augustine's - the Holy Spirit, Who spoke by them, did not intend to teach men these things - that is the essential nature of the things of the universe - things in no way profitable to salvation"; which principle "will apply to cognate sciences, and especially to history," that is, by refuting, "in a somewhat similar way the fallacies of the adversaries and defending the historical truth of Sacred Scripture from their attacks." Nor is the sacred writer to be taxed with error, if "copyists have made mistakes in the text of the Bible," or, "if the real meaning of a passage remains ambiguous." Finally it is absolutely wrong and forbidden "either to narrow inspiration to certain passages of Holy Scripture, or to admit that the sacred writer has erred," since divine inspiration "not only is essentially incompatible with error but excludes and rejects it as absolutely and necessarily as it is impossible that God Himself, the supreme Truth, can utter that which is not true. This is the ancient and constant faith of the Church."
Source: Divino Afflante Spiritu (Vatican.va)