Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bpo-26219: Fix compiler warning #13809

Merged
merged 1 commit into from
Jun 4, 2019
Merged

bpo-26219: Fix compiler warning #13809

merged 1 commit into from
Jun 4, 2019

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Jun 4, 2019

Fix this warning with MSVC:

objects\codeobject.c(264): warning C4244: '=':
conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data

https://bugs.python.org/issue26219

Fix this warning with MSVC:

    objects\codeobject.c(264): warning C4244: '=':
    conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data
@vstinner vstinner requested a review from methane June 4, 2019 14:41
@vstinner vstinner merged commit ea9f168 into python:master Jun 4, 2019
@vstinner vstinner deleted the codeobject_warn branch June 4, 2019 15:08
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86 Windows7 3.x has failed when building commit ea9f168.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/58/builds/2573) and take a look at the build logs.
  4. Check if the failure is related to this commit (ea9f168) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/58/builds/2573

Click to see traceback logs
From https://github.com/python/cpython
 * branch            master     -> FETCH_HEAD
Reset branch 'master'

The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, functio
n, script file, or operable program. Check the spelling of the name, or if a pa
th was included, verify that the path is correct and try again.
At line:1 char:18
+ Invoke-WebRequest <<<<  https://aka.ms/nugetclidl -OutFile 'D:\cygwin\home\db
3l\buildarea\3.x.bolen-windows7\build\Tools\buildbot\..\..\PCbuild\..\externals
\nuget.exe'
    + CategoryInfo          : ObjectNotFound: (Invoke-WebRequest:String) [], C 
   ommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
'py' is not recognized as an internal or external command,
operable program or batch file.
'"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\Tools\buildbot\..\..\PCbuild\..\externals\nuget.exe"' is not recognized as an internal or external command,
operable program or batch file.
The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, functio
n, script file, or operable program. Check the spelling of the name, or if a pa
th was included, verify that the path is correct and try again.
At line:1 char:18
+ Invoke-WebRequest <<<<  https://aka.ms/nugetclidl -OutFile 'D:\cygwin\home\db
3l\buildarea\3.x.bolen-windows7\build\Tools\buildbot\..\..\PCbuild\..\externals
\nuget.exe'
    + CategoryInfo          : ObjectNotFound: (Invoke-WebRequest:String) [], C 
   ommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
'py' is not recognized as an internal or external command,
operable program or batch file.
'"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\Tools\buildbot\..\..\PCbuild\..\externals\nuget.exe"' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\Lib\*.pyc
The system cannot find the file specified.
Could Not Find D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PCbuild\python*.zip
The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, functio
n, script file, or operable program. Check the spelling of the name, or if a pa
th was included, verify that the path is correct and try again.
At line:1 char:18
+ Invoke-WebRequest <<<<  https://aka.ms/nugetclidl -OutFile 'D:\cygwin\home\db
3l\buildarea\3.x.bolen-windows7\build\PCbuild\\..\externals\nuget.exe'
    + CategoryInfo          : ObjectNotFound: (Invoke-WebRequest:String) [], C 
   ommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
'py' is not recognized as an internal or external command,
operable program or batch file.
'"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PCbuild\\..\externals\nuget.exe"' is not recognized as an internal or external command,
operable program or batch file.

test_multiprocessing_forkserver skipped -- forkserver is not available on Windows
test_xxtestfuzz skipped -- No module named '_xxtestfuzz'
test_dbm_ndbm skipped -- No module named '_dbm'
test_fcntl skipped -- No module named 'fcntl'
minkernel\crts\ucrt\src\appcrt\lowio\write.cpp(49) : Assertion failed: (_osfile(fh) & FOPEN)
test_grp skipped -- No module named 'grp'
test_multiprocessing_fork skipped -- fork is not available on Windows
test_wait3 skipped -- os.fork not defined
test_spwd skipped -- No module named 'spwd'
test_syslog skipped -- No module named 'syslog'
test_pty skipped -- No module named 'termios'
test_dbm_gnu skipped -- No module named '_gdbm'
test_posix skipped -- No module named 'posix'
test_epoll skipped -- test works only on Linux 2.6
test_ioctl skipped -- No module named 'fcntl'
test_fork1 skipped -- object <module 'os' from 'D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows7\\build\\lib\\os.py'> has no attribute 'fork'
test_threadsignals skipped -- Can't test signal on win32
test_pwd skipped -- No module named 'pwd'
test_wait4 skipped -- object <module 'os' from 'D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows7\\build\\lib\\os.py'> has no attribute 'fork'
test_devpoll skipped -- test works only on Solaris OS family
test_zipfile64 skipped -- test requires loads of disk-space bytes and a long time to run
test_kqueue skipped -- test works only on BSD
test_crypt skipped -- No module named '_crypt'
test_ossaudiodev skipped -- No module named 'ossaudiodev'
test_poll skipped -- select.poll not defined
test_pipes skipped -- pipes module only works on posix
Timeout (0:35:00)!
Thread 0x000000c0 (most recent call first):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\subprocess.py", line 1332 in _readerthread
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\threading.py", line 865 in run
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\threading.py", line 923 in _bootstrap_inner
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\threading.py", line 885 in _bootstrap

Thread 0x00000c6c (most recent call first):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\subprocess.py", line 1332 in _readerthread
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\threading.py", line 865 in run
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\threading.py", line 923 in _bootstrap_inner
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\threading.py", line 885 in _bootstrap

Thread 0x00000350 (most recent call first):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\threading.py", line 1015 in _wait_for_tstate_lock
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\threading.py", line 999 in join
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\subprocess.py", line 1361 in _communicate
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\subprocess.py", line 999 in communicate
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_venv.py", line 40 in check_output
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\test_venv.py", line 327 in test_multiprocessing
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", line 628 in _callTestMethod
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", line 671 in run
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\case.py", line 731 in __call__
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", line 122 in run
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", line 84 in __call__
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", line 122 in run
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", line 84 in __call__
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", line 122 in run
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\suite.py", line 84 in __call__
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\unittest\runner.py", line 176 in run
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py", line 1984 in _run_suite
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py", line 2080 in run_unittest
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py", line 203 in _test_module
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py", line 228 in _runtest_inner2
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py", line 264 in _runtest_inner
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py", line 135 in _runtest
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest.py", line 187 in runtest
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\runtest_mp.py", line 66 in run_tests_worker
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py", line 611 in _main
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py", line 588 in main
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py", line 663 in main
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\regrtest.py", line 46 in _main
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\regrtest.py", line 50 in <module>
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\runpy.py", line 85 in _run_code
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\runpy.py", line 192 in _run_module_as_main
minkernel\crts\ucrt\src\appcrt\lowio\write.cpp(49) : Assertion failed: (_osfile(fh) & FOPEN)
minkernel\crts\ucrt\src\appcrt\lowio\close.cpp(49) : Assertion failed: (_osfile(fh) & FOPEN)
minkernel\crts\ucrt\src\appcrt\lowio\close.cpp(49) : Assertion failed: (_osfile(fh) & FOPEN)
test_openpty skipped -- os.openpty() not available.
stty: standard input: Inappropriate ioctl for device
test_readline skipped -- No module named 'readline'
test_nis skipped -- No module named 'nis'
test_resource skipped -- No module named 'resource'
test_curses skipped -- No module named '_curses'
test_gdb skipped -- Couldn't find gdb on the path
Traceback (most recent call last):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py", line 1006, in temp_dir
    yield path
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py", line 1058, in temp_cwd
    yield cwd_dir
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py", line 588, in main
    self._main(tests, kwargs)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py", line 658, in _main
    sys.exit(0)
SystemExit: 0

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py", line 329, in _force_run
    return func(*args)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows7\\build\\build\\test_python_3040\\worker_3236'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\runpy.py", line 192, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\__main__.py", line 2, in <module>
    main()
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py", line 663, in main
    Regrtest().main(tests=tests, **kwargs)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\libregrtest\main.py", line 588, in main
    self._main(tests, kwargs)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py", line 1058, in temp_cwd
    yield cwd_dir
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py", line 1011, in temp_dir
    rmtree(path)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py", line 451, in rmtree
    _rmtree(path)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py", line 392, in _rmtree
    _waitfor(_rmtree_inner, path, waitall=True)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py", line 340, in _waitfor
    func(pathname)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py", line 389, in _rmtree_inner
    _force_run(fullname, os.rmdir, fullname)
  File "D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\lib\test\support\__init__.py", line 335, in _force_run
    return func(*args)
PermissionError: [WinError 32] The process cannot access the file because it is being used by another process: 'D:\\cygwin\\home\\db3l\\buildarea\\3.x.bolen-windows7\\build\\build\\test_python_3040\\worker_3236'

The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, functio
n, script file, or operable program. Check the spelling of the name, or if a pa
th was included, verify that the path is correct and try again.
At line:1 char:18
+ Invoke-WebRequest <<<<  https://aka.ms/nugetclidl -OutFile 'D:\cygwin\home\db
3l\buildarea\3.x.bolen-windows7\build\Tools\buildbot\..\..\PCbuild\..\externals
\nuget.exe'
    + CategoryInfo          : ObjectNotFound: (Invoke-WebRequest:String) [], C 
   ommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
'py' is not recognized as an internal or external command,
operable program or batch file.
'"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\Tools\buildbot\..\..\PCbuild\..\externals\nuget.exe"' is not recognized as an internal or external command,
operable program or batch file.
The term 'Invoke-WebRequest' is not recognized as the name of a cmdlet, functio
n, script file, or operable program. Check the spelling of the name, or if a pa
th was included, verify that the path is correct and try again.
At line:1 char:18
+ Invoke-WebRequest <<<<  https://aka.ms/nugetclidl -OutFile 'D:\cygwin\home\db
3l\buildarea\3.x.bolen-windows7\build\Tools\buildbot\..\..\PCbuild\..\externals
\nuget.exe'
    + CategoryInfo          : ObjectNotFound: (Invoke-WebRequest:String) [], C 
   ommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException
 
'py' is not recognized as an internal or external command,
operable program or batch file.
'"D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\Tools\buildbot\..\..\PCbuild\..\externals\nuget.exe"' is not recognized as an internal or external command,
operable program or batch file.
Could Not Find D:\cygwin\home\db3l\buildarea\3.x.bolen-windows7\build\PCbuild\python*.zip

DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
)

Fix this MSVC warning:

    objects\codeobject.c(264): warning C4244: '=':
    conversion from 'Py_ssize_t' to 'unsigned char', possible loss of data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants