1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
|
Index: twisted/conch/unix.py
===================================================================
--- twisted/conch/unix.py (revision 17447)
+++ twisted/conch/unix.py (revision 17448)
@@ -4,12 +4,11 @@
#
from twisted.cred import portal
-from twisted.python import components, log, util
+from twisted.python import components, log
from twisted.internet.process import ProcessExitedAlready
from zope import interface
from ssh import session, forwarding, filetransfer
from ssh.filetransfer import FXF_READ, FXF_WRITE, FXF_APPEND, FXF_CREAT, FXF_TRUNC, FXF_EXCL
-from ssh.connection import OPEN_UNKNOWN_CHANNEL_TYPE
from twisted.conch.ls import lsLine
from avatar import ConchUser
@@ -21,7 +20,6 @@
import pwd, grp
import pty
import ttymodes
-import os
try:
import utmp
@@ -320,8 +318,8 @@
"uid" : s.st_uid,
"gid" : s.st_gid,
"permissions" : s.st_mode,
- "atime" : s.st_atime,
- "mtime" : s.st_mtime
+ "atime" : int(s.st_atime),
+ "mtime" : int(s.st_mtime)
}
def _absPath(self, path):
Index: twisted/conch/test/test_manhole.py
===================================================================
--- twisted/conch/test/test_manhole.py (revision 17246)
+++ twisted/conch/test/test_manhole.py (revision 17478)
@@ -4,4 +4,6 @@
from __future__ import generators
+
+import traceback
from twisted.trial import unittest
@@ -9,4 +11,15 @@
from twisted.conch.test.test_recvline import _TelnetMixin, _SSHMixin, _StdioMixin, stdio, ssh
from twisted.conch import manhole
+
+def determineDefaultFunctionName():
+ """
+ Return the string used by Python as the name for code objects which are
+ compiled from interactive input or at the top-level of modules.
+ """
+ try:
+ 1 / 0
+ except:
+ return traceback.extract_stack()[0][2]
+defaultFunctionName = determineDefaultFunctionName()
@@ -130,5 +143,5 @@
[">>> 1 / 0",
"Traceback (most recent call last):",
- ' File "<console>", line 1, in ?',
+ ' File "<console>", line 1, in ' + defaultFunctionName,
"ZeroDivisionError: integer division or modulo by zero",
">>> done"])
|