upstream python has capital P in dirname