mirror of
				https://github.com/f-droid/fdroidserver.git
				synced 2025-11-04 14:30:30 +03:00 
			
		
		
		
	Merge branch 'encoding-warning' into 'master'
log a warning when encoding is not set to utf-8 Closes #617 See merge request fdroid/fdroidserver!619
This commit is contained in:
		
						commit
						9bc81f2689
					
				
					 1 changed files with 9 additions and 1 deletions
				
			
		
							
								
								
									
										10
									
								
								fdroid
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								fdroid
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -19,6 +19,7 @@
 | 
			
		|||
 | 
			
		||||
import sys
 | 
			
		||||
import os
 | 
			
		||||
import locale
 | 
			
		||||
import logging
 | 
			
		||||
 | 
			
		||||
import fdroidserver.common
 | 
			
		||||
| 
						 | 
				
			
			@ -120,7 +121,8 @@ def main():
 | 
			
		|||
    logging.basicConfig(format=logformat, level=loglevel)
 | 
			
		||||
 | 
			
		||||
    if verbose and quiet:
 | 
			
		||||
        logging.critical("Specifying --verbose and --quiet and the same time is silly")
 | 
			
		||||
        logging.critical(_("Conflicting arguments: '--verbose' and '--quiet' "
 | 
			
		||||
                           "can not be specified at the same time."))
 | 
			
		||||
        sys.exit(1)
 | 
			
		||||
 | 
			
		||||
    # temporary workaround until server.py becomes deploy.py
 | 
			
		||||
| 
						 | 
				
			
			@ -134,6 +136,12 @@ def main():
 | 
			
		|||
    del sys.argv[1]
 | 
			
		||||
    mod = __import__('fdroidserver.' + command, None, None, [command])
 | 
			
		||||
 | 
			
		||||
    system_langcode, system_encoding = locale.getdefaultlocale()
 | 
			
		||||
    if system_encoding.lower() not in ('utf-8', 'utf8'):
 | 
			
		||||
        logging.warn(_("Encoding is set to '{enc}' fdroid might run "
 | 
			
		||||
                       "into encoding issues. Please set it to 'UTF-8' "
 | 
			
		||||
                       "for best results.".format(enc=system_encoding)))
 | 
			
		||||
 | 
			
		||||
    try:
 | 
			
		||||
        mod.main()
 | 
			
		||||
    # These are ours, contain a proper message and are "expected"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue