backport-1.8-3953

Backport #3953:`MAINT: io: handle a bad fmt argument in savetxt by raising a ValueError.`