Biblical Commentary on the Old Testament, by Carl Friedrich Keil and Franz Delitzsh, [1857-78], at sacred-texts.com
In Potiphar's House. - Potiphar had bought him of the Ishmaelites, as is repeated in Gen 39:1 for the purpose of resuming the thread of the narrative; and Jehovah was with him, so that the prospered in the house of his Egyptian master. מצליח אישׁ: a man who has prosperity, to whom God causes all that he undertakes and does to prosper. When Potiphar perceived this, Joseph found favour in his eyes, and became his servant, whom he placed over his house (made manager of his household affairs), and to whom he entrusted all his property (כּל־ישׁ־לו Gen 39:4 = ישׁ־לו כּל־אשׁר Gen 39:5, Gen 39:6). This confidence in Joseph increased, when he perceived how the blessing of Jehovah (Joseph's God) rested upon his property in the house and in the field; so that now "he left to Joseph everything that he had, and did not trouble himself אתּו (with or near him) about anything but his own eating."
Joseph was handsome in form and feature; and Potiphar's wife set her eyes upon the handsome young man, and tried to persuade him to lie with her. But Joseph resisted the adulterous proposal, referring to the unlimited confidence which his master had placed in him. He (Potiphar) was not greater in that house than he, and had given everything over to him except her, because she was his wife. "How could he so abuse this confidence, as to do this great wickedness and sin against God!"
But after she had repeated her enticements day after day without success, "it came to pass at that time (הזּה כּהיּום for the more usual הזּה כּיּום (Gen 50:20), lit., about this day, i.e., the day in the writer's mind, on which the thing to be narrated occurred) that Joseph came into his house to attend to his duties, and there were none of the house-servants within." And she laid hold of him by his garment and entreated him to lie with her; but he left his garment in her hand and fled from the house.
When this daring assault upon Joseph's chastity had failed, on account of his faithfulness and fear of God, the adulterous woman reversed the whole affair, and charged him with an attack upon her modesty, in order that she might have her revenge upon him and avert suspicion from herself. She called her house-servants and said, "See, he (her husband, whom she does not think worth naming) has brought us a Hebrew man ("no epitheton ornans to Egyptian ears: Gen 43:32") to mock us (צחק to show his wantonness; us, the wife and servants, especially the female portion): he came in unto me to lie with me; and I cried with a loud voice...and he left his garment by me." She said אצלי "by my side," not "in my hand," as that would have shown the true state of the case. She then left the garment lying by her side till the return of Joseph's master, to whom she repeated her tale.
Joseph in Prison. - Potiphar was enraged at what he heard, and put Joseph into the prison where (אשׁר for שׁם אשׁר, Gen 40:3 like Gen 35:13) the king's prisoners (state-prisoners) were confined. הסּהר בּית: lit., the house of enclosure, from סהר, to surround or enclose (ὀχύρωμα, lxx); the state-prison surrounded by a wall. This was a very moderate punishment. For according to Diod. Sic. (i. 78) the laws of the Egyptians were πικροὶ περὶ τῶν γυναιῶν νόμοι. An attempt at adultery was to be punished with 1000 blows, and rape upon a free woman still more severely. It is possible that Potiphar was not fully convinced of his wife's chastity, and therefore did not place unlimited credence in what she said.
(Note: Credibile est aliquod fuisse indicium, quo Josephum innocentem esse Potiphari constiteret; neque enim servi vita tanti erat ut ei parceretur in tam gravi delicto. Sed licet innocuum, in carcere tamen detinebat, ut uxoris honori et suo consuleret (Clericus). The chastity of Egyptian women has been in bad repute from time immemorial (Diod. Sic. i. 59; Herod. ii. 111). Even in the middle ages the Fatimite Hakim thought it necessary to adopt severe measures against their immorality (Bar-Hebraei, chron. p. 217), and at the present day, according to Burckhardt (arab. Sprichwrter, pp. 222, 227), chastity is "a great rarity" among women of every rank in Cairo.)
But even in that case it was the mercy of the faithful covenant God, which now as before (Gen 37:20.) rescued Joseph's life.
In the prison itself Jehovah was with Joseph, procuring him favour in the eyes of the governor of the prison, so that he entrusted all the prisoners to his care, leaving everything that they had to do, to be done through him, and not troubling himself about anything that was in his hand, i.e., was committed to him, because Jehovah made all that he did to prosper. "The keeper" was the governor of the prison, or superintendent of the gaolers, and was under Potiphar, the captain of the trabantes and chief of the executioners (Gen 37:36).