Quasi-static implies that T aprox equals Tsurr? A few days ago I re-visited my undergraduate thermodynamics notes and (as you may have seen from the amount of questions I have been posting) I have encountered many difficulties that I overlooked at that time.
And I think most of my problems come from how unclear is the concept of quasi-static process in books.
Many textbooks define a quasi-static process as:


  A process that has its macroscopic variables well defined and in the system it is at each instant of time in a state infinitesimally close to the state of equilibrium.


The first part of that definition is logical. But the second part, related to thermodynamical equilibrium confuses me.
What is clear is that if it is stated that a certain process is quasistatic, then the pressure of the system is infinitesimally similar to the external pressure, which allows us to easily calculate the volumetric work.

My concise doubt comes from the relationship of the external temperature with the internal temperature. We know that for a system to be in true equilibrium with the outside, both pressure and temperature must be the same (without considering material equilibrium). 

If this is the case, T system should be infinitesimally equal to T of the environment which would completely eliminate the generation of entropy by transfer between finite temperatures.

Now, when one studies theoretical cycles, it is generally stated that they are internally reversible ( quasi-static internally and without internal friction) but irreversible at last because the unstopabble heat transfer between finite temperatures in many steps.

I see a contradiction here:
As I understand it, many define a quasistatic process as: 


"An extremely slow process where internally the P and the T are equal, homogeneous". (Completely agree)
"The system  at each instant of time in a state infinitesimally close to the state of equilibrium". Dont' get it since many problems considers Pexternal=Psystem but T System different to T surroundigs.


To me, it should be called partially quasistatic process if Tsys does not equals to Tsurroundings.

Regards.
In my judgment, when they are talking about irreversible cycles, they are referring to idealized cases in which (a) the process is internally reversible with respect to the working fluid but (b) irreversible with regard to the region outside the working fluid where there is a finite thermal resistance (e.g., a cylinder wall with finite thermal conductivity) between an (external) ideal constant-temperature reservoir and the working fluid.  So the rate of heat transfer to the working fluid is very low (quasi static), and all the entropy generation takes place within the (higher) thermal resistance wall.  At least, this is how the irreversibility is often modeled.

To illustrate all this, see the following thread from Physics Stack Exchange:  https://physics.stackexchange.com/questions/443527/entropy-generation-in-an-endoreversible-engine