File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -39,8 +39,14 @@ def murmur2_x86(data, seed):
39
39
40
40
def get_tmp_directory ():
41
41
tmp_dir = tempfile .gettempdir ()
42
+ if os .name == 'nt' :
43
+ try :
44
+ import win32file
45
+ tmp_dir = win32file .GetLongPathName (tmp_dir )
46
+ except :
47
+ pass
42
48
pid = os .getpid ()
43
- return tmp_dir + '/ ipykernel_' + str (pid )
49
+ return tmp_dir + os . sep + ' ipykernel_' + str (pid )
44
50
45
51
46
52
def get_tmp_hash_seed ():
@@ -52,7 +58,7 @@ def get_file_name(code):
52
58
cell_name = os .environ .get ("IPYKERNEL_CELL_NAME" )
53
59
if cell_name is None :
54
60
name = murmur2_x86 (code , get_tmp_hash_seed ())
55
- cell_name = get_tmp_directory () + '/' + str (name ) + '.py'
61
+ cell_name = get_tmp_directory () + os . sep + str (name ) + '.py'
56
62
return cell_name
57
63
58
64
Original file line number Diff line number Diff line change @@ -507,7 +507,7 @@ async def debugInfo(self, message):
507
507
'isStarted' : self .is_started ,
508
508
'hashMethod' : 'Murmur2' ,
509
509
'hashSeed' : get_tmp_hash_seed (),
510
- 'tmpFilePrefix' : get_tmp_directory () + '/' ,
510
+ 'tmpFilePrefix' : get_tmp_directory () + os . sep ,
511
511
'tmpFileSuffix' : '.py' ,
512
512
'breakpoints' : breakpoint_list ,
513
513
'stoppedThreads' : self .stopped_threads ,
Original file line number Diff line number Diff line change @@ -69,6 +69,7 @@ def run(self):
69
69
'matplotlib-inline>=0.1.0,<0.2.0' ,
70
70
'appnope;platform_system=="Darwin"' ,
71
71
'nest_asyncio' ,
72
+ 'pywin32;platform_system=="Windows"'
72
73
],
73
74
extras_require = {
74
75
"test" : [
You can’t perform that action at this time.
0 commit comments