In Homily 33, delivered probably in 591, Pope Gregory I (Saint Gregory the Great) took the step of identifying Luke's unnamed sinner with Mary Magdalen:
"We believe that this woman [Mary Magdalen] is Luke's female sinner, the woman John calls Mary, and that Mary from whom Mark says seven demons were cast out."
Homily 33 is recorded in Homiliarum in evangelia, Lib. II, Patrologia Latina, vol. 76 (Paris: J.-P. Migne, 1844-1864), cols. 1238-1246
("Hanc vero quam Lucas peccatricem mulierem, Joannes Mariam nominat, illam esse Mariam credimus de qua Marcus septem dæmonia ejecta fuisse testatur")
The seven demons Gregory identified as "all the vices" ("Et quid per septem dæmonia, nisi universa vitia designantur?") by which he means the seven so-called cardinal sins (including lust, which was understood as inordinate or illicit sexual desire). The seven cardinal sins were first grouped as such by Gregory. The passages mentioning Christ's casting out of the seven devils from Mary Magdalen are in Luke 8: 1-3, and Mark 16: 9.
Gregory then explained that the ointment used by Luke's unnamed sinner, now Mary Magdalen, to anoint Christ's feet had previously been used by her "to perfume her flesh in forbidden acts."
("Liquet...quod illicitus actibus prius mulier intenta unguentum sibi pro odore suæ carnis adhibuit")
It was Gregory who also associated her, again primarily through identification with Luke's unnamed sinner, as a penitent when he explained that by immolating herself at the feet of Jesus, "she turned the mass of her crimes to virtues, in order to serve God entirely in penance."
("Convertit ad virtutum numerum criminum, ut totum serviret Deo in poenitentia")