The Duke Humfrey's Library made a huge exception for filming The Restricted Section scene. Even though the historic library usually strictly forbids bringing flames into the library for any reason, they made an exception for Harry Potter. It was the first exception in hundreds of years.