Index: wp-includes/post.php
===================================================================
--- wp-includes/post.php	(revision 35862)
+++ wp-includes/post.php	(working copy)
@@ -4300,7 +4300,7 @@
 
 	foreach ( $page->ancestors as $parent ) {
 		$parent = get_post( $parent );
-		if ( 'publish' === $parent->post_status ) {
+		if ( 'trash' !== $parent->post_status ) {
 			$uri = $parent->post_name . '/' . $uri;
 		}
 	}
