[issue41716] SyntaxError: EOL while scanning string literal

2021-06-08 Thread elonjigar


elonjigar  added the comment:

An EOL while scanning string literal error indicates that the Python 
interpreter expected a particular character or set of characters to have 
occurred in a specific line of code, but that those characters were not found 
before the end of the line . This results in Python stopping the program 
execution and throwing a syntax error . In most cases, this is  due to the 
following reasons:

Missing quotes
Strings spanning multiple lines

Strings can't normally span multiple lines. If you don't want the string to 
appear on multiple lines but you want to initialize it on multiple lines (so 
you can read it more easily), you can "escape" the newline by putting a 
backslash before the newline. If you want it to appear on multiple lines, you 
can use triple quotes around the string.

http://net-informations.com/python/err/eol.htm

--
nosy: +elonjigar

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41716] SyntaxError: EOL while scanning string literal

2020-09-10 Thread Larry Hastings


Change by Larry Hastings :


--
components: +Interpreter Core -Argument Clinic
nosy:  -larry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41716] SyntaxError: EOL while scanning string literal

2020-09-10 Thread chen-y0y0


chen-y0y0  added the comment:

Yep.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41716] SyntaxError: EOL while scanning string literal

2020-09-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

See the FAQ:

https://docs.python.org/3/faq/design.html#why-can-t-raw-strings-r-strings-end-with-a-backslash

Also documented here:

https://docs.python.org/dev/reference/lexical_analysis.html#string-and-bytes-literals

Previous issues: #1271 and #31136

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41716] SyntaxError: EOL while scanning string literal

2020-09-04 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

You can't end a string with a bare backslash, not even an raw string.

--
nosy: +steven.daprano
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue41716] SyntaxError: EOL while scanning string literal

2020-09-04 Thread chen-y0y0

New submission from chen-y0y0 :

# I try to run:
import os
os.system(r"start C:\Windows\System32\")
# But I get an Exception:
SyntaxError: EOL while scanning string literal
# A string after “r” means the string's original meaning. But……

--
components: Argument Clinic
messages: 376361
nosy: larry, prasechen
priority: normal
severity: normal
status: open
title: SyntaxError: EOL while scanning string literal
type: compile error
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com