cms-sw / cmssw

CMS Offline Software
http://cms-sw.github.io/
Apache License 2.0
1.08k stars 4.32k forks source link

Cleanup python stack in exception message in python3 #26594

Open Dr15Jones opened 5 years ago

Dr15Jones commented 5 years ago

When dumping the python stack for cmsRun exception message reporting using python 3, there are very many lines starting with <frozen which are not present in python 2.

cmsbuild commented 5 years ago

A new Issue was created by @Dr15Jones Chris Jones.

@davidlange6, @Dr15Jones, @smuzaffar, @fabiocos, @kpedro88 can you please review it and eventually sign/assign? Thanks.

cms-bot commands are listed here

Dr15Jones commented 5 years ago

A concrete example is running cmsRun $CMSSW_RELEASE_BASE/src/FWCore/Integration/test/importRestrictions2.py

in python 2 we get exception message

----- Begin Fatal Exception 02-May-2019 09:24:38 CDT-----------------------
An exception of category 'ConfigFileReadError' occurred while
   [0] Processing the python configuration file named /cvmfs/cms-ib.cern.ch/week0/slc7_amd64_gcc700/cms/cmssw-patch/CMSSW_10_6_X_2019-04-30-2300/src/FWCore/Integration/test/importRestrictions2.py
Exception Message:
 unknown python problem occurred.
ImportError: Inclusion of /cvmfs/cms-ib.cern.ch/week0/slc7_amd64_gcc700/cms/cmssw-patch/CMSSW_10_6_X_2019-04-30-2300/python/FWCore/Integration/restricted_cff.py is allowed only by cfg or specified cfi files.

At:
  /uscms_data/d2/cdj/build/temp/fix/CMSSW_10_6_X_2019-04-30-2300/python/FWCore/ParameterSet/Config.py(82): checkImportPermission
  /cvmfs/cms-ib.cern.ch/week0/slc7_amd64_gcc700/cms/cmssw-patch/CMSSW_10_6_X_2019-04-30-2300/python/FWCore/Integration/restricted_cff.py(3): <module>
  /cvmfs/cms-ib.cern.ch/week0/slc7_amd64_gcc700/cms/cmssw-patch/CMSSW_10_6_X_2019-04-30-2300/python/FWCore/Integration/forbidden_cff.py(4): <module>
  /uscms_data/d2/cdj/build/temp/fix/CMSSW_10_6_X_2019-04-30-2300/python/FWCore/ParameterSet/Config.py(597): load
  /cvmfs/cms-ib.cern.ch/week0/slc7_amd64_gcc700/cms/cmssw-patch/CMSSW_10_6_X_2019-04-30-2300/src/FWCore/Integration/test/importRestrictions2.py(7): <module>

----- End Fatal Exception -------------------------------------------------

under python 3 we get

----- Begin Fatal Exception 02-May-2019 09:33:45 CDT-----------------------
An exception of category 'ConfigFileReadError' occurred while
   [0] Processing the python configuration file named /cvmfs/cms-ib.cern.ch/week0/slc7_amd64_gcc700/cms/cmssw/CMSSW_10_6_DEVEL_X_2019-04-30-2300/src/FWCore/Integration/test/importRestrictions2.py
Exception Message:
 unknown python problem occurred.
ImportError: Inclusion of /uscms_data/d2/cdj/build/temp/fix/CMSSW_10_6_DEVEL_X_2019-04-30-2300/python/FWCore/Integration/restricted_cff.py is allowed only by cfg or specified cfi files.

At:
  /uscms_data/d2/cdj/build/temp/fix/CMSSW_10_6_DEVEL_X_2019-04-30-2300/python/FWCore/ParameterSet/Config.py(80): checkImportPermission
  /uscms_data/d2/cdj/build/temp/fix/CMSSW_10_6_DEVEL_X_2019-04-30-2300/python/FWCore/Integration/restricted_cff.py(3): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(678): exec_module
  <frozen importlib._bootstrap>(665): _load_unlocked
  <frozen importlib._bootstrap>(955): _find_and_load_unlocked
  <frozen importlib._bootstrap>(971): _find_and_load
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap>(1031): _handle_fromlist
  /uscms_data/d2/cdj/build/temp/fix/CMSSW_10_6_DEVEL_X_2019-04-30-2300/python/FWCore/Integration/forbidden_cff.py(4): <module>
  <frozen importlib._bootstrap>(219): _call_with_frames_removed
  <frozen importlib._bootstrap_external>(678): exec_module
  <frozen importlib._bootstrap>(665): _load_unlocked
  <frozen importlib._bootstrap>(955): _find_and_load_unlocked
  <frozen importlib._bootstrap>(971): _find_and_load
  /uscms_data/d2/cdj/build/temp/fix/CMSSW_10_6_DEVEL_X_2019-04-30-2300/python/FWCore/ParameterSet/Config.py(595): load
  /cvmfs/cms-ib.cern.ch/week0/slc7_amd64_gcc700/cms/cmssw/CMSSW_10_6_DEVEL_X_2019-04-30-2300/src/FWCore/Integration/test/importRestrictions2.py(7): <module>

----- End Fatal Exception -------------------------------------------------
Dr15Jones commented 5 years ago

assign core

Dr15Jones commented 5 years ago

@davidlange6 FYI

cmsbuild commented 5 years ago

New categories assigned: core

@Dr15Jones,@smuzaffar you have been requested to review this Pull request/Issue and eventually sign? Thanks