Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
alecs_myu
erp5
Commits
4c76bc61
Commit
4c76bc61
authored
Sep 15, 2013
by
Kazuhiko Shiozaki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace popen2.popen3 with subprocess.Popen.
parent
6905aa33
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
10 deletions
+16
-10
product/ERP5/tests/testXHTML.py
product/ERP5/tests/testXHTML.py
+16
-10
No files found.
product/ERP5/tests/testXHTML.py
View file @
4c76bc61
...
...
@@ -29,7 +29,6 @@
import
unittest
import
os
import
popen2
import
urllib
from
subprocess
import
Popen
,
PIPE
...
...
@@ -443,12 +442,13 @@ class W3Validator(object):
source
=
'fragment=%s&output=soap12'
%
urllib
.
quote_plus
(
page_source
)
os
.
environ
[
'CONTENT_LENGTH'
]
=
str
(
len
(
source
))
os
.
environ
[
'REQUEST_METHOD'
]
=
'POST'
stdout
,
stdin
,
stderr
=
popen2
.
popen3
(
self
.
validator_path
)
stdin
.
write
(
source
)
stdin
.
close
()
while
stdout
.
readline
()
!=
'
\
n
'
:
pass
result
=
stdout
.
read
()
process
=
Popen
([
self
.
validator_path
],
stdin
=
PIPE
,
stdout
=
PIPE
,
stderr
=
PIPE
,
close_fds
=
True
)
try
:
stdout
,
stderr
=
process
.
communicate
(
source
)
finally
:
del
process
result
=
stdout
.
split
(
'
\
n
\
n
'
,
1
)[
-
1
]
return
self
.
_parse_validation_results
(
result
)
...
...
@@ -489,9 +489,15 @@ class TidyValidator(object):
'''
retrun two list : a list of errors and an other for warnings
'''
stdout
,
stdin
,
stderr
=
popen2
.
popen3
(
'%s -e -q -utf8'
%
self
.
validator_path
)
stdin
.
write
(
page_source
)
stdin
.
close
()
if
isinstance
(
page_source
,
unicode
):
# Zope 2.12 renders page templates as unicode
page_source
=
page_source
.
encode
(
'utf-8'
)
process
=
Popen
([
self
.
validator_path
,
'-e'
,
'-q'
,
'-utf8'
],
stdin
=
PIPE
,
stdout
=
PIPE
,
stderr
=
PIPE
,
close_fds
=
True
)
try
:
stdout
,
stderr
=
process
.
communicate
(
page_source
)
finally
:
del
process
return
self
.
_parse_validation_results
(
stderr
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment