mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-04 03:27:00 -05:00 
			
		
		
		
	Sanitize env when running curl in test
This commit is contained in:
		
							parent
							
								
									508fbc057f
								
							
						
					
					
						commit
						3998c2490c
					
				@ -46,6 +46,8 @@ class Test(Command):
 | 
				
			|||||||
            sys.libxslt_dylib = ctypes.CDLL(os.path.join(os.environ['SW'], 'lib', 'libxslt.dylib'))
 | 
					            sys.libxslt_dylib = ctypes.CDLL(os.path.join(os.environ['SW'], 'lib', 'libxslt.dylib'))
 | 
				
			||||||
            sys.libexslt_dylib = ctypes.CDLL(os.path.join(os.environ['SW'], 'lib', 'libexslt.dylib'))
 | 
					            sys.libexslt_dylib = ctypes.CDLL(os.path.join(os.environ['SW'], 'lib', 'libexslt.dylib'))
 | 
				
			||||||
            print(sys.libxml2_dylib, sys.libxslt_dylib, sys.libexslt_dylib, file=sys.stderr, flush=True)
 | 
					            print(sys.libxml2_dylib, sys.libxslt_dylib, sys.libexslt_dylib, file=sys.stderr, flush=True)
 | 
				
			||||||
 | 
					            os.non_calibre_subprocess_env = e = os.environ
 | 
				
			||||||
 | 
					            del e['DYLD_LIBRARY_PATH']
 | 
				
			||||||
        from calibre.utils.run_tests import (
 | 
					        from calibre.utils.run_tests import (
 | 
				
			||||||
            filter_tests_by_name, remove_tests_by_name, run_cli, find_tests
 | 
					            filter_tests_by_name, remove_tests_by_name, run_cli, find_tests
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
 | 
				
			|||||||
@ -233,7 +233,7 @@ class TestAuth(BaseTest):
 | 
				
			|||||||
            if curl:
 | 
					            if curl:
 | 
				
			||||||
                def docurl(data, *args):
 | 
					                def docurl(data, *args):
 | 
				
			||||||
                    cmd = [curl] + list(args) + ['http://localhost:%d/closed' % server.address[1]]
 | 
					                    cmd = [curl] + list(args) + ['http://localhost:%d/closed' % server.address[1]]
 | 
				
			||||||
                    p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
 | 
					                    p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL, env=getattr(os, 'non_calibre_subprocess_env', os.environ))
 | 
				
			||||||
                    x = p.stdout.read()
 | 
					                    x = p.stdout.read()
 | 
				
			||||||
                    p.wait()
 | 
					                    p.wait()
 | 
				
			||||||
                    self.ae(x, data)
 | 
					                    self.ae(x, data)
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user