Magma degassing, characterized by changes in permeability and porosity distribution, has a crucial control on the style of eruption. During ascent, magma might develop large porosities and crystallize while it is subjected to shear. Shear, in turn, enhances complex fabrics that result from the reorganization of the different phases (crystals, gas, melt). Such fabrics have not yet been evaluated experimentally on a three-phase system. We performed torsion experiments on a synthetic crystal-rich hydrous magma at subsolidus conditions with 11 vol% porosity to establish a link between strain partitioning and porosity redistribution. Crystals induce non-Newtonian deformation, resulting in localization of the shear strain. Three-dimensional microtomography and two-dimensional scanning electron microscope imaging show gas accumulation in local microstructures caused by shear-induced crystal fabric. Our data show that strain localization is a mechanism that could enable magma degassing at very low vesicularity.