I have this slight variation of an example from the answers package
\documentclass[12pt,a4paper]{article}
\usepackage{ifthen}
\usepackage{answers}
\Newassociation{sol}{Solution}{ans}
\newboolean{InSol}\setboolean{InSol}{False}
\newenvironment{Sol}
% Need to know whether we are in a solution or not
% So we set a defined boolean to test this
{\setboolean{InSol}{True}\begin{sol}}
%
{\end{sol}\setboolean{InSol}{False}}
\begin{document}
\Opensolutionfile{ans}[ans1]
First exercise
\begin{Sol}
First solution.
\end{Sol}
Second exercise
\begin{Sol}
Second solution.
\end{Sol}
\Closesolutionfile{ans}
\section{Solutions}
\input{ans1}
\end{document}
And it produces following answer file
\begin{Solution}{}
First solution.
\end{Sol}
Second exercise
\begin{Sol}
Second solution.
\end{Sol}
\Closesolutionfile{ans}
\section{Solutions}
\input{ans1}
\end{document}
Is this a bug or am I doing something stupid?