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

The 'Cancel' button is not visible in Python 3.x #312

Closed
my8100 opened this issue Apr 15, 2019 · 6 comments · Fixed by #315
Closed

The 'Cancel' button is not visible in Python 3.x #312

my8100 opened this issue Apr 15, 2019 · 6 comments · Fixed by #315
Milestone

Comments

@my8100
Copy link
Collaborator

my8100 commented Apr 15, 2019

It should be if b'cancel.json' not in self.root.children: for Python 3.x

scrapyd/scrapyd/website.py

Lines 141 to 143 in d3f47f3

if 'cancel.json' not in self.root.children:
col_idx = self.header_cols.index('Cancel') + 1
css.append('#jobs>*>tr>*:nth-child(%d) {display: none}' % col_idx)

@Digenis
Copy link
Member

Digenis commented Apr 16, 2019

I think the real problem is that we read the configuration without regard to encoding.

self.cp = SafeConfigParser()
self.cp.readfp(StringIO(default_config))
self.cp.read(sources)
for fp in extra_sources:
self.cp.readfp(fp)

Does this work for you?

    self.cp = SafeConfigParser()
    self.cp.readfp(StringIO(default_config))
    self.cp.read(sources)
    for fname in extra_sources:
        with io.open(fname) as fp:
            self.cp.readfp(fp)

@my8100
Copy link
Collaborator Author

my8100 commented Apr 16, 2019

No, it still doesn't work for Python 3

if 'cancel.json' not in self.root.children:

print(self.root.children.keys()) still shows dict_keys([b'', b'logs', b'jobs', b'schedule.json', b'cancel.json'...

@my8100
Copy link
Collaborator Author

my8100 commented Apr 16, 2019

@Digenis Actually, I really doubt who would deactivate cancel.json.

@Digenis Digenis closed this as completed Apr 16, 2019
@Digenis Digenis reopened this Apr 16, 2019
@my8100 my8100 changed the title The 'Cancel' button is not visable in Python 3.x The 'Cancel' button is not visible in Python 3.x Apr 20, 2019
@my8100
Copy link
Collaborator Author

my8100 commented May 31, 2019

@Digenis
The problem still exists in Python 3.7.
Did you test before merging #315?

@Digenis
Copy link
Member

Digenis commented Jun 1, 2019

fixed in e3c9f91

@Digenis
Copy link
Member

Digenis commented Jun 1, 2019

I only tested whether it reads correctly a file with non-ascii-encodable resource names.
But these were different bugs. Something that I completely forgot when I opened #315.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants