mirror of
				https://github.com/kovidgoyal/calibre.git
				synced 2025-11-04 03:27:00 -05:00 
			
		
		
		
	Fix #4570 (Windows: Error when adding PDF where metadata contains illegal path components)
This commit is contained in:
		
							parent
							
								
									0377f9b43c
								
							
						
					
					
						commit
						3f98797f21
					
				@ -92,6 +92,8 @@ def sanitize_file_name(name, substitute='_', as_unicode=False):
 | 
				
			|||||||
    if as_unicode:
 | 
					    if as_unicode:
 | 
				
			||||||
        one = one.decode(filesystem_encoding)
 | 
					        one = one.decode(filesystem_encoding)
 | 
				
			||||||
    one = one.replace('..', substitute)
 | 
					    one = one.replace('..', substitute)
 | 
				
			||||||
 | 
					    if one.endswith('.'):
 | 
				
			||||||
 | 
					        one = one[:-1]+'_'
 | 
				
			||||||
    return one
 | 
					    return one
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user