mirror of
				https://github.com/python/cpython.git
				synced 2025-10-31 13:41:24 +00:00 
			
		
		
		
	Issue #17225: JSON decoder now counts columns in the first line starting
with 1, as in other lines.
This commit is contained in:
		
						commit
						920007ad76
					
				
					 6 changed files with 25 additions and 10 deletions
				
			
		|  | @ -24,7 +24,7 @@ def linecol(doc, pos): | |||
|         newline = '\n' | ||||
|     lineno = doc.count(newline, 0, pos) + 1 | ||||
|     if lineno == 1: | ||||
|         colno = pos | ||||
|         colno = pos + 1 | ||||
|     else: | ||||
|         colno = pos - doc.rindex(newline, 0, pos) | ||||
|     return lineno, colno | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Serhiy Storchaka
						Serhiy Storchaka