This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 270447 - Auto Format removes format . import *
Summary: Auto Format removes format . import *
Status: STARTED
Alias: None
Product: python
Classification: Unclassified
Component: Editor (show other bugs)
Version: 8.2
Hardware: PC Windows 7
: P2 normal (vote)
Assignee: Lou Dasaro
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-20 19:11 UTC by g.mann
Modified: 2017-06-10 22:02 UTC (History)
1 user (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description g.mann 2017-04-20 19:11:03 UTC
I am using Django, and in the tutorial they ask us to write this statement:

from . import views

this is supposed to import the file "views.py". But every time I auto-format (Alt-Shift-F), it results in this statement:

from  import views

which is obviously an error.
Comment 1 Jenselme 2017-06-10 22:02:03 UTC
Thanks for you report. I was able to reproduce the problem. It comes from a bug in jython (http://bugs.jython.org/issue2598).

In the mean time, I made a workaround in
changeset:   18492:fcbdc73e2a68
bookmark:    main
tag:         tip
parent:      18487:2b8a31fe02a4
user:        Julien Enselme <jenselme@netbeans.org>
date:        Sat Jun 10 22:44:51 2017 +0200
summary:     #270447: work around a bug in jython to fix formatting of `from . import views`

In the meantime you can try the development nbms (at your own risk): https://bitbucket.org/Jenselme/nb-contrib/downloads/2017-06-10-nbpython-nbms.zip