# expl3 problem, File ended while scanning use of \__file_parse_version:w

today I ran into a problem while compiling a .tex document. (I'm compiling with the Sublime Text 3 Build command) The minimal working example looks like this.

\documentclass[a4paper, 10pt]{article}
\usepackage{csquotes}
\usepackage[T1]{fontenc}
\usepackage[czech]{babel}
\usepackage{biblatex}

\title{Test}
\author{}
\date{}

\tracingcommands=1
\begin{document}
\tracingcommands=0

\maketitle
test

\end{document}


The errors listed in the console are

TeX STOPPED: File ended while scanning use of \__file_parse_version:2021-01-09\s__file_stop \__int_eval_end: \exp_after:wN \use_ii:nn \fi:
TeX reports the error was in file:3 \begin{document}


and the warnings

/Users/ondra/Downloads/test.tex: LaTeX Warning: You have requested, on input line 15, version 2020/04/06' of package expl3, but only version 2021-01-09 L3 programming layer (loader) ' is available.



I can spot some weird behaviour while looking into the .log file.

(/usr/local/texlive/2020basic/texmf-dist/tex/latex/l3kernel/expl3.sty
{\def}
{\let}
{\xdef}
{\edef}
{\let}
{\def}
{\def}
{\futurelet}
{\let}
{\futurelet}
{\let}
{\let}
{\let}
{\afterassignment}
{\xdef}
{\let}
{\let}
{\begingroup}
{\let}
{\immediate}
Package: expl3 2021-01-09 L3 programming layer (loader)
{\endgroup}
{\protected}
{blank space  }
{\protected}
{blank space  }
{\protected}
{blank space  }
{\protected}
{blank space  }
{\protected}
{blank space  }
{\begingroup}
{\endgroup}
{\begingroup}
{\endgroup}
)
Runaway argument?
2021-01-09\s__file_stop \__int_eval_end: \exp_after:wN \use_ii:nn \fi: \ETC.
! File ended while scanning use of \__file_parse_version:w.
<inserted text>
\par
l.13 \begin{document}

I suspect you have forgotten a }', causing me
to read past where you wanted me to stop.
I'll try to recover; but if the error is serious,
you'd better type E' or X' now and fix your file.

! Missing number, treated as zero.
\__kernel_tl_set:Nx
l.13 \begin{document}

A number should have been here; I inserted 0'.
(If you can't figure out why I needed to see a number,
look up weird error' in the index to The TeXbook.)

{begin-group character {}
{\relax}
{\begingroup}
{\def}
{\let}
{\immediate}

LaTeX Warning: You have requested, on input line 13, version
2020/04/06' of package expl3,
but only version
2021-01-09 L3 programming layer (loader) '
is available.

{\endgroup}
{end-group character }}
{\xdef}
{\edef}
{\global}
{\gdef}
{\gdef}
{\catcode}
{\relax}
{\gdef}
{\gdef}
{\xdef}
{\xdef}
{\edef}
{\xdef}
{\xdef}
{\xdef}
{\edef}
{\global}
{\global}
{\global}
{\relax}
{\begingroup}
{\let}
{\let}
{\relax}
{\begingroup}
{\def}
{\let}
{\immediate}
Package biblatex Info: ... but expl3
(biblatex)             2021-01-09 L3 programming layer (loader)
(biblatex)             is too old (older than 2020/04/06),
(biblatex)             setting 'casechanger=latex2e'.


Especially the last lines, where the version 2021-01-09 is treated as older than 2020/04/06.

I can get rid of this error by either commenting out the line \usepackage[czech]{babel} or \usepackage{biblatex}. But if they are imported together, the error described above occurs.

My pdftex -v console dump:

pdfTeX 3.14159265-2.6-1.40.21 (TeX Live 2020)
kpathsea version 6.3.2
Copyright 2020 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.37; using libpng 1.6.37
Compiled with zlib 1.2.11; using zlib 1.2.11


What should I focus on? Should I try to downgrade my L3 programming layer down to the version 2020/04/06? Thank you for your advice and time in advance.

• Workaround for now: Load \usepackage{expl3} before \usepackage{biblatex}. (The current version of biblatex loads expl3 very late. Possibly even after Czech has interfered with some category codes, maybe that of -...) Feb 1, 2021 at 11:08
• @moewe The problem is indeed the category code of -, which is set to active by babel-czech before biblatex does its check about the version of expl3. Why doing the check so late? Feb 1, 2021 at 11:25
• Another workaround is to load biblatex before babel. Feb 1, 2021 at 11:26
• @moewe I wouldn't defer this tests to begindocument. Users should set the input encoding at the begin, before loading packages, and biblatex should be allowed to rely on it. Use the input encoding active when biblatex is loaded, and only test at begin document if something changed to warn that something is wrong. Feb 1, 2021 at 11:40

## Update

This issue was resolved in biblatex 3.17. Update your TeX system.

This issue was caused by biblatex delaying loading expl3 to the last minute when it can make the best guess about the document encoding (this is required since biblatex loads different code for the case changer depending on whether or not the document is UTF-8-encoded, see https://github.com/plk/biblatex/issues/1058).

Unfortunately, expl3 is loaded so late that the Czech language module has already changed the category codes of the hyphen -, which causes trouble here.

Since loading the case changing code so late caused trouble in other contexts as well (https://github.com/plk/biblatex/issues/1090), biblatex will now try to guess the file encoding when it is loaded and will warn when that guess differs from the guess made later in an \AtBeginDocument hook (see https://github.com/plk/biblatex/commit/15a62fb5bb227db5ef613aaa13778d92bd190f29). This means that inputenc and friends should be loaded before biblatex (this was always a good idea, but is now necessary to get things right).

The problem will be resolved in the next biblatex version (v3.17). In the meantime a workaround would be to load expl3 explicitly before biblatex.

\documentclass[a4paper, 10pt]{article}

\usepackage[T1]{fontenc}
\usepackage[czech]{babel}
\usepackage{csquotes}
\usepackage{expl3}
\usepackage{biblatex}

\begin{document}
test
\end{document}

• Awesome, thank you! The workaround with loading expl3 before biblatex` worked for me. Feb 1, 2021 at 18:23