Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

script failed with trailing comma in a field #107

Open
awais786 opened this issue Dec 20, 2019 · 0 comments
Open

script failed with trailing comma in a field #107

awais786 opened this issue Dec 20, 2019 · 0 comments

Comments

@awais786
Copy link
Contributor

awais786 commented Dec 20, 2019

At the end there is a trailing comma and script failed on it.

models.OneToOneField('ArticleRevision',verbose_name=_(u'current revision'),blank=True, null=True, related_name='current_set' ,)
Here is a complete traceback
-    current_revision = models.OneToOneField('ArticleRevision',verbose_name=_(u'current revision'),blank=True, null=True, related_name='current_set',)
+    current_revision = models.OneToOneField('ArticleRevision',verbose_name=_(u'current revision'),blank=True, null=True, related_name='current_set',, on_delete=models.CASCADE)

     created = models.DateTimeField(auto_now_add=True, verbose_name=_(u'created'))
     modified = models.DateTimeField(auto_now=True, verbose_name=_(u'modified'),
ERR:tool.py:216  Bowler exception during transform of /Users/abc/Documents/devstack/django-wiki/wiki/plugins/attachments/models.py: Transforms generated invalid CST for /Users/abc/Documents/devstack/django-wiki/wiki/plugins/attachments/models.py
Traceback (most recent call last):
  File "/Users/abc/.virtualenvs/repo-toolspy37/lib/python3.7/site-packages/bowler/tool.py", line 145, in processed_file
    new_tree = self.driver.parse_string(new_text)
  File "/Users/abc/.virtualenvs/repo-toolspy37/lib/python3.7/site-packages/fissix/pgen2/driver.py", line 102, in parse_string
    return self.parse_tokens(tokens, debug)
  File "/Users/abc/.virtualenvs/repo-toolspy37/lib/python3.7/site-packages/fissix/pgen2/driver.py", line 71, in parse_tokens
    if p.addtoken(type, value, (prefix, start)):
  File "/Users/abc/.virtualenvs/repo-toolspy37/lib/python3.7/site-packages/fissix/pgen2/parse.py", line 164, in addtoken
    raise ParseError("bad input", type, value, context)
fissix.pgen2.parse.ParseError: bad input: type=12, value=',', context=('', (24, 148))

The above exception was the direct cause of the following exception:

It adds double comma

+    current_revision = models.OneToOneField('ArticleRevision',verbose_name=_(u'current revision'),blank=True, null=True, related_name='current_set'
,, 
on_delete=models.CASCADE)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant