Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cython
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cython
Commits
1c9e174d
Commit
1c9e174d
authored
8 years ago
by
scoder
Committed by
GitHub
8 years ago
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1580 from jiajunhuang/py2k3k
Fix Python 2 and 3 have diffrent default encoding
parents
71ec1a4a
4b95ec8e
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
15 deletions
+27
-15
Cython/Debugger/Cygdb.py
Cython/Debugger/Cygdb.py
+15
-13
Cython/Debugger/libcython.py
Cython/Debugger/libcython.py
+12
-2
No files found.
Cython/Debugger/Cygdb.py
View file @
1c9e174d
...
@@ -138,7 +138,8 @@ def main(path_to_debug_info=None, gdb_argv=None, no_import=False):
...
@@ -138,7 +138,8 @@ def main(path_to_debug_info=None, gdb_argv=None, no_import=False):
tempfilename
=
make_command_file
(
path_to_debug_info
,
no_import
=
no_import
)
tempfilename
=
make_command_file
(
path_to_debug_info
,
no_import
=
no_import
)
logger
.
info
(
"Launching %s with command file: %s and gdb_argv: %s"
,
logger
.
info
(
"Launching %s with command file: %s and gdb_argv: %s"
,
options
.
gdb
,
tempfilename
,
gdb_argv
)
options
.
gdb
,
tempfilename
,
gdb_argv
)
logger
.
debug
(
'Command file (%s) contains: """
\
n
%s"""'
,
tempfilename
,
open
(
tempfilename
).
read
())
with
open
(
tempfilename
)
as
tempfile
:
logger
.
debug
(
'Command file (%s) contains: """
\
n
%s"""'
,
tempfilename
,
tempfile
.
read
())
logger
.
info
(
"Spawning %s..."
,
options
.
gdb
)
logger
.
info
(
"Spawning %s..."
,
options
.
gdb
)
p
=
subprocess
.
Popen
([
options
.
gdb
,
'-command'
,
tempfilename
]
+
gdb_argv
)
p
=
subprocess
.
Popen
([
options
.
gdb
,
'-command'
,
tempfilename
]
+
gdb_argv
)
logger
.
info
(
"Spawned %s (pid %d)"
,
options
.
gdb
,
p
.
pid
)
logger
.
info
(
"Spawned %s (pid %d)"
,
options
.
gdb
,
p
.
pid
)
...
@@ -151,6 +152,7 @@ def main(path_to_debug_info=None, gdb_argv=None, no_import=False):
...
@@ -151,6 +152,7 @@ def main(path_to_debug_info=None, gdb_argv=None, no_import=False):
pass
pass
else
:
else
:
break
break
logger
.
debug
(
"Closing temp command file with fd: %s"
,
tempfile
.
fileno
())
logger
.
debug
(
"Removing temp command file: %s"
,
tempfilename
)
logger
.
debug
(
"Removing temp command file: %s"
,
tempfilename
)
os
.
remove
(
tempfilename
)
os
.
remove
(
tempfilename
)
logger
.
debug
(
"Removed temp command file: %s"
,
tempfilename
)
logger
.
debug
(
"Removed temp command file: %s"
,
tempfilename
)
This diff is collapsed.
Click to expand it.
Cython/Debugger/libcython.py
View file @
1c9e174d
...
@@ -18,6 +18,13 @@ import collections
...
@@ -18,6 +18,13 @@ import collections
import
gdb
import
gdb
try
:
# python 2
UNICODE
=
unicode
BYTES
=
str
except
NameError
:
# python 3
UNICODE
=
str
BYTES
=
bytes
try
:
try
:
from
lxml
import
etree
from
lxml
import
etree
have_lxml
=
True
have_lxml
=
True
...
@@ -689,7 +696,8 @@ class CyImport(CythonCommand):
...
@@ -689,7 +696,8 @@ class CyImport(CythonCommand):
completer_class
=
gdb
.
COMPLETE_FILENAME
completer_class
=
gdb
.
COMPLETE_FILENAME
def
invoke
(
self
,
args
,
from_tty
):
def
invoke
(
self
,
args
,
from_tty
):
args
=
args
.
encode
(
_filesystemencoding
)
if
isinstance
(
args
,
BYTES
):
args
=
args
.
decode
(
_filesystemencoding
)
for
arg
in
string_to_argv
(
args
):
for
arg
in
string_to_argv
(
args
):
try
:
try
:
f
=
open
(
arg
)
f
=
open
(
arg
)
...
@@ -834,7 +842,9 @@ class CyBreak(CythonCommand):
...
@@ -834,7 +842,9 @@ class CyBreak(CythonCommand):
gdb
.
execute
(
'break %s'
%
func
.
pf_cname
)
gdb
.
execute
(
'break %s'
%
func
.
pf_cname
)
def
invoke
(
self
,
function_names
,
from_tty
):
def
invoke
(
self
,
function_names
,
from_tty
):
argv
=
string_to_argv
(
function_names
.
encode
(
'UTF-8'
))
if
isinstance
(
function_names
,
BYTES
):
function_names
=
function_names
.
decode
(
_filesystemencoding
)
argv
=
string_to_argv
(
function_names
)
if
function_names
.
startswith
(
'-p'
):
if
function_names
.
startswith
(
'-p'
):
argv
=
argv
[
1
:]
argv
=
argv
[
1
:]
python_breakpoints
=
True
python_breakpoints
=
True
...
...
This diff is collapsed.
Click to expand it.
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