[issue38583] The activate script in Windows is not correct for venvs created in git-bash

2019-10-24 Thread Mo


New submission from Mo :

When creating a virtual environment on Windows from git-bash (using python -m 
venv), VIRTUAL_ENV in the activate script is set using a windows style path 
(C:\some\path) instead of the bash style (/c/some/path).

This means the system python and pip get used, despite the user thinking they 
are working in a venv after sourcing activate.

As activate is a bash script, the paths in it should always be in the bash 
style, regardless of platform.

This is described in a stack overflow issue here: 
https://stackoverflow.com/questions/57758841/windows-virtualenv-created-via-gitbash-using-system-python

I have confirmed the behaviour in 3.7.3, 3.7.4, 3.7.5 and 3.8.0.

--
components: Windows
messages: 355333
nosy: Mo, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: The activate script in Windows is not correct for venvs created in 
git-bash
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 
<https://bugs.python.org/issue38583>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38583] The activate script in Windows is not correct for venvs created in git-bash

2019-10-25 Thread Mo


Mo  added the comment:

The issue comes as a result of abspath on line 59 of venv/__init__.py:
env_dir = os.path.abspath(env_dir)

This returns a Windows-style path, and os.path.abspath returning in this way is 
*probably* correct, as the OS is Windows, despite trying to forget that by 
using bash.

It is still my view that the activate script is a bash script, and therefore 
should only contain paths in that style, but the simple solution to this issue 
is to change the double quotes around the definition of $VIRTUAL_ENV in the 
activate script to single quotes. It works. The output of "which python" is a 
bit odd, but this is clearly a quirk beyond Python's control.

--

___
Python tracker 
<https://bugs.python.org/issue38583>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue38583] The activate script in Windows is not correct for venvs created in git-bash

2019-11-06 Thread Mo


Mo  added the comment:

I had also tested with pathlib and posixpath and come to the same conclusion.

As suggested by you, I looked into `activate` determining path when run. I 
believe this should do the trick (My bashfoo isn't strong, this is mostly from 
https://stackoverflow.com/a/179231):

pushd . > /dev/null
SCRIPT_PATH="${BASH_SOURCE[0]}"
if ([ -h "${SCRIPT_PATH}" ]); then
  while([ -h "${SCRIPT_PATH}" ]); do cd `dirname "$SCRIPT_PATH"`; 
  SCRIPT_PATH=`readlink "${SCRIPT_PATH}"`; done
fi
cd `dirname ${SCRIPT_PATH}` > /dev/null
cd .. > /dev/null
SCRIPT_PATH=`pwd`;
popd  > /dev/null

VIRTUAL_ENV="$SCRIPT_PATH"

--

___
Python tracker 
<https://bugs.python.org/issue38583>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21623] build ssl failed use vs2010 express

2014-05-31 Thread Mo Jia

New submission from Mo Jia:

Here is the failed message . 


Project "D:\Hg\Python\Python\PCbuild\_ssl.vcxproj" (17) is building 
"D:\Hg\Python\Python\PCbuild\ssl.vcxproj" (18) on node 1 (default targets). 

Build:  


  cd "D:\Hg\Python\Python\PCbuild\" 


  "D:\Hg\Python\Python\PCbuild\python_d.exe" build_ssl.py Release Win32 -a  





  Found a working perl at 'C:\Perl\bin\perl.exe'


  Executing ssl makefiles: nmake /nologo -f "ms\nt.mak" 


  Building OpenSSL  


copy ".\crypto\buildinf.h" "tmp32\buildinf.h"   


  1 file(s) copied. 


copy ".\crypto\opensslconf.h" "inc32\openssl\opensslconf.h" 


  1 file(s) copied. 


  cl /Fotmp32\shatest.obj -Iinc32 -Itmp32 /MT /Ox /O2 /Ob2 
-DOPENSSL_THREADS  -DDSO_WIN32 -W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 
-DWIN32_LEAN_AND_MEAN -DL_ENDIAN 
   -D_CRT_SECURE_NO_DEPRECATE -DOPENSSL_BN_ASM_PART_WORDS -DOPENSSL_IA32_SSE2 
-DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM 
-DSHA512_ASM -DMD5_ASM -DRMD160_A 
  SM -DAES_ASM -DVPAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DOPENSSL_NO_IDEA 
-DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_MDC2 -DOPENSSL_NO_KRB5 
-DOPENSSL_NO_JPAKE -DOPENSSL_NO_DYNA 
  MIC_ENGINE /Zi /Fdtmp32/app -c .\crypto\sha\shatest.c 


  shatest.c 


link /nologo /subsystem:console /opt:ref /debug /out:out32\shatest.exe 
@C:\Users\YANXIN~1\AppData\Local\Temp\nm306E.tmp
 
libeay32.lib(b_print.obj) : error LNK2019: unresolved external symbol 
___report_rangecheckfailure referenced in function _fmtfp 
[D:\Hg\Python\Python\PCbuild\ssl.vcxproj]   
libeay32.lib(obj_dat.obj) : error LNK2001: unresolved external symbol 
___report_rangecheckfailure [D:\Hg\Python\Python\PCbuild\ssl.vcxproj]   
  
libeay32.lib(b_dump.obj) : error LNK2001: unresolved external symbol 
___report_rangecheckfailure [D:\Hg\Python\Python\PCbuild\ssl.vcxproj]   
   
libeay32.lib(pem_lib.obj) : error LNK2001: unresolved external symbol 
___report_rangecheckfailure [D:\Hg\Python\Python\PCbuild\ssl.vcxproj]   
  
out32\shatest.exe : fatal error LNK1120: 1 unresolved externals 
[D:\Hg\Python\Python\PCbuild\ssl.vcxproj]   

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 
10.0\VC\bin\link.EXE"' : return code '0x460' 
[D:\Hg\Python\Python\PCbuild\ssl.vcxproj]  
  Stop. 


  Executing ms\nt.mak failed


  2

--
components: Windows
messages:

[issue21623] build ssl failed use vs2010 express

2014-06-01 Thread Mo Jia

Mo Jia added the comment:

Another error is .

  cd "D:\Hg\Python\Python\PCbuild\"
  "D:\Hg\Python\Python\PCbuild\python_d.exe" build_ssl.py Release Win32 -a

  Found a working perl at 'C:\Perl\bin\perl.exe'
  Traceback (most recent call last):
File "build_ssl.py", line 253, in 
  main()
File "build_ssl.py", line 181, in main
  ssl_dir = get_ssl_dir()
File "build_ssl.py", line 70, in get_ssl_dir
  m = re.search('openssl-([^<]+)<', f.read())
  UnicodeDecodeError: 'gbk' codec can't decode byte 0xbf in position 2: illegal 
multibyte sequence
C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error 
MSB3073: The command "cd "D:\Hg\Python\Python\PCbuild\" 
[D:\Hg\Python\Python\PCbuild\ssl. vcxproj]
C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error 
MSB3073: "D:\Hg\Python\Python\PCbuild\python_d.exe" build_ssl.py Release Win32 
-a [D:\Hg\ Python\Python\PCbuild\ssl.vcxproj]
C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error 
MSB3073: " exited with code 1. [D:\Hg\Python\Python\PCbuild\ssl.vcxproj]

--

___
Python tracker 
<http://bugs.python.org/issue21623>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21623] build ssl failed use vs2010 express

2014-06-03 Thread Mo Jia

Mo Jia added the comment:

@Roundup Robot . Clone the newest 3.4 tag. The unicode problem is ok now .
@Zachary Ware , don't change anything after clone from the repo. What i do is 
just cd python src dir and runing : Tools\buildbot\build.bat .  the openssl 
verison is 1.0.1g . Seem the external.bat don't build openssl . I see the 
readme " The ssl.vcxproj sub-project simply invokes PCbuild/build_ssl.py,   
 which locates and builds OpenSSL." Seem I don't need build the openssl by 
handle .  After meet the error , I open the sln by vc2010 , and choose the ssl 
project build . Here is another error :

4>  pymath.c
4>  pytime.c
4>  pystate.c
4>  pystrcmp.c
4>  pystrtod.c
4>  dtoa.c
4>  Python-ast.c
4>  pythonrun.c
4>  structmember.c
4>  symtable.c
4>  sysmodule.c
4>  thread.c
4>  traceback.c
4>  Generating Code...
4>  The syntax of the command is incorrect.
4>  cl.exe -c -D_WIN32 -DUSE_DL_EXPORT -D_WINDOWS -DWIN32 -D_WINDLL -D_DEBUG 
-MDd ..\Modules\getbuildinfo.c 
-Fo"D:\Hg\Python\Python\PCbuild\Win32-temp-Debug\pythoncore\getbuildinfo.o" 
-I..\Include -I..\PC
4>  The syntax of the command is incorrect.
4> Creating library D:\Hg\Python\Python\PCbuild\python34_d.lib and object 
D:\Hg\Python\Python\PCbuild\python34_d.exp
4>  pythoncore.vcxproj -> D:\Hg\Python\Python\PCbuild\python34_d.dll
5>-- Build started: Project: python, Configuration: Debug Win32 --
5>  python.c
5>  python.vcxproj -> D:\Hg\Python\Python\PCbuild\python_d.exe
6>-- Build started: Project: ssl, Configuration: Debug Win32 --
6>  Found a working perl at 'D:\cygwin64\bin\perl.exe'
6>  Executing ssl makefiles: nmake /nologo -f "ms\nt.mak"
6>  The syntax of the command is incorrect.
6>  Executing ms\nt.mak failed
6>  1
6>C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error 
MSB3073: The command "cd "D:\Hg\Python\Python\PCbuild\"
6>C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error 
MSB3073: "D:\Hg\Python\Python\PCbuild\python_d.exe" build_ssl.py Release Win32 
-a
6>C:\Program Files 
(x86)\MSBuild\Microsoft.Cpp\v4.0\Microsoft.MakeFile.Targets(38,5): error 
MSB3073: " exited with code 1.

--

___
Python tracker 
<http://bugs.python.org/issue21623>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29297] python3 open() does not check argument type before attempting to read() or write()

2017-01-17 Thread Mo Ali

New submission from Mo Ali:

Python3 open(), read(), or write()doesn't check argument type before action 
causing a hang.  Would like to catch exceptions but not without an exception to 
return.  See below.

Python3.6:
Python 3.6.0 (default, Dec 24 2016, 08:01:42)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> test = False
>>> with open(str(test)) as f:
... fail = f.read()
...


python2.7:
╰─λ python2 

0 < 09:35:31
Python 2.7.13 (default, Dec 18 2016, 07:03:39)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> test = False
>>> with open(test) as f:
... fail = f.read()
...
Traceback (most recent call last):
  File "", line 1, in 
TypeError: coercing to Unicode: need string or buffer, bool found

--
messages: 285644
nosy: Mo Ali
priority: normal
severity: normal
status: open
title: python3 open() does not check argument type before attempting to read() 
or write()
type: crash
versions: Python 3.5

___
Python tracker 
<http://bugs.python.org/issue29297>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29297] python3 open() does not check argument type before attempting to read() or write()

2017-01-17 Thread Mo Ali

Mo Ali added the comment:

Serhiy,

I expected a type error or a filenotfound like you received, however mine 
doesn't return the same. It just hangs.  I've attached a picture.  Also, I 
meant this to be for 3.6 not 3.5.

>>> test = False
>>> with open(test) as f:
... fail = f.read()
...

--
versions: +Python 3.6 -Python 3.5
Added file: http://bugs.python.org/file46315/Screen Shot 2017-01-17 at 10.09.35 
AM.png

___
Python tracker 
<http://bugs.python.org/issue29297>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29191] liblzma is missing from pcbuild.sln

2017-02-23 Thread Mo Jia

Mo Jia added the comment:

I think let user add the liblzma project by hand is not good enough. While the 
build.bat don't have this problem. So they should work similar.

--
nosy: +Mo.Jia
versions:  -Python 3.5, Python 3.6

___
Python tracker 
<http://bugs.python.org/issue29191>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue46703] boolean operation issue (True == False == False)

2022-02-09 Thread jung mo sohn


New submission from jung mo sohn :

In python 3.6.8, 3.7.3, 3.7.4, 3.7.5, 3.7.12, 3.8.8 versions, the output is 
False as shown below.

Python 3.7.5 (tags/v3.7.5:5c02a39a0b, Oct 15 2019, 00:11:34) [MSC v.1916 64 bit 
(AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> print(True == False == False)
False

However, in the openjdk1.8 version, the output is "true" as shown below. 

public class Test {
public static void main(String[] args) throws Exception{
System.out.println(true == false == false);
}
}

> java Test
true

In my opinion, "True" seems to be correct.

--
components: Parser
messages: 412961
nosy: jmsohn.x, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: boolean operation issue (True == False == False)
type: behavior
versions: Python 3.7, Python 3.8

___
Python tracker 
<https://bugs.python.org/issue46703>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com