Skip to content

String double quoted fatal problem #48414

Description

@cliffdover88
BPO 4164
Nosy @amauryfa

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2008-10-21.21:05:19.495>
created_at = <Date 2008-10-21.20:10:24.689>
labels = ['invalid', 'build', 'library']
title = 'String double quoted fatal problem'
updated_at = <Date 2008-10-21.21:05:19.440>
user = 'https://bugs.python.org/cliffdover88'

bugs.python.org fields:

activity = <Date 2008-10-21.21:05:19.440>
actor = 'amaury.forgeotdarc'
assignee = 'none'
closed = True
closed_date = <Date 2008-10-21.21:05:19.495>
closer = 'amaury.forgeotdarc'
components = ['Library (Lib)']
creation = <Date 2008-10-21.20:10:24.689>
creator = 'cliffdover88'
dependencies = []
files = []
hgrepos = []
issue_num = 4164
keywords = []
message_count = 2.0
messages = ['75038', '75047']
nosy_count = 2.0
nosy_names = ['amaury.forgeotdarc', 'cliffdover88']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = None
status = 'closed'
superseder = None
type = 'compile error'
url = 'https://bugs.python.org/issue4164'
versions = ['Python 2.6']

Activity

  1. cliffdover88 commented on Oct 21, 2008

    cliffdover88mannequin
    MannequinAuthor

    Hi

    I have a problem with python 2.6, when i try to process strings with
    triple-quoted string literal i get an error:

    a='a''a' #1 double quoted Ok
    
    a='a''''a' # 2 Ok
    
    a= 'a''''''a' # 3 doble quoted -- SyntaxError: EOF while scanning
    triple-quoted string literal
    
    a= 'a''''''''a' # 4 ok
    
    a='a''''''''''a' # 5 same error impair doble quoted
    
    a='a''''''''''''a' # 6 Ok...............

    a... #7 error..................

  2. added
    stdlibStandard Library Python modules in the Lib/ directory
    buildThe build process and cross-build
    on Oct 21, 2008
  3. amauryfa commented on Oct 21, 2008

    @amauryfa
    Contributor

    All your samples explain easily if you consider that two adjacent string
    literals are joined together. (You seem to consider that "double quote"
    is a way to insert a quote character. It's not; Python is not Pascal or
    SQL)

    Your first two examples become:
    a='a''a' two adjacent strings == 'aa'
    a='a''''a' three adjacent strings ('a' + '' + 'a') == 'aa'

    The third is an error:
    a='a''''''a' one string ('a') followed by the beginning of a "triple
    quoted string" (''') which content starts with the characters (''a') but
    does not have a matching (''') to finish the string, hence the Syntax
    error.

    ... and so on. Please have a look at http://docs.python.org/reference/lexical_analysis.html#string-literals

  4. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    buildThe build process and cross-buildstdlibStandard Library Python modules in the Lib/ directory

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions